Use AppDomain to load/unload external assemblies

后端 未结 8 2026
遇见更好的自我
遇见更好的自我 2020-12-24 08:39

My scenario is as follows:

  • Create new AppDomain
  • Load some assemblies into it
  • Do some magic with loaded dlls
  • Unload AppDomain to rele
8条回答
  •  [愿得一人]
    2020-12-24 09:28

    This is not a complete answer: I just noticed that you use a string as payload. Strings are not useful for this, as literal strings are interned. The interned strings are shared among AppDomains, so that part is not unloaded when you unload your AppDomain. Try using a byte[] instead.

提交回复
热议问题