How to reload an assembly for a .NET Application Domain?

后端 未结 4 1340
鱼传尺愫
鱼传尺愫 2020-12-10 16:53

We are loading an assembly (a DLL) which reads a configuration file. We need to change the configuration file and then re-load the assembly. We see that after loading the a

4条回答
  •  一生所求
    2020-12-10 17:41

    You can't unload an assembly once it's been loaded. However, you can unload an AppDomain, so your best bet would be to load the logic into a separate AppDomain and then when you want to reload the assembly you'll have to unload the AppDomain and then reload it.

提交回复
热议问题