Help needed with unloading .DLL's from AppDomain - Still not working even with ShadowCopy

前端 未结 3 1540
执笔经年
执笔经年 2020-12-21 07:01

I am trying to do the following. App A is the \"mother app\". It stays open. App B is just a .DLL where I write some classes that are derived from an interface specified in

3条回答
  •  醉话见心
    2020-12-21 07:46

    Your code still runs in the mother AppDomain, as you're pulling in assemblies and types into there. Any code should run in the spawned domain. I've shown one way to set something like that up on my website : A simple way to start your code in a different AppDomain

    I'm not 100% sure on that but that's certainly one step you'll have to undertake

    Update

    In terms of the solution presented there, your instantiation of a runner would happen in an inheritor of DomainLifetimeHook. The infrastructure shown ensures that the Start and Stop methods run in the AppDomain created by the class AppDomainExpander. That Expander is the class that creates the new domain, hence your domain setup should go in the Create method of the domain.

提交回复
热议问题