Hot Unload/Reload of a DLL used by an Application

后端 未结 3 1183
无人共我
无人共我 2020-11-27 21:11

I have an application that loads a DLL to execute a specific part of processing

Example : \"Application.dll\" loading \"Process.dll\" 

3条回答
  •  难免孤独
    2020-11-27 22:10

    While you seem to solve the problem according to your edit here are couple comments:

    Watch out for objects from your Process.dll "leaking" into main AppDomain. I.e. something like throwing custom exception defined in Process.dll and caught in main AppDomain will force Process.dll to be loaded into main AppDomain. Check list of loaded assemblies in the main AppDomain after performing operations you are interested in.

    Unloading of AppDomain can fail and may take long time.

提交回复
热议问题