Loading/Unloading assembly in different AppDomain

后端 未结 3 1526
忘掉有多难
忘掉有多难 2020-12-04 15:52

I need to execute a method in an assembly loaded during runtime. Now I want to unload those loaded assemblies after the method call. I know that I need a new AppDomain so I

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 16:36

    Take a look into this previous answer: How to load an assembly into different AppDomain on Windows Mobile (.NET CF) ?. That answer creates a proxy class which runs into new AppDomain context so, there, you can have full control of your initialization.

    You could to create a Start() method into ServiceApplicationProxy class and just call it normally from your hoster with a proxy.Start().

提交回复
热议问题