How do appDomain provide Isolation

核能气质少年 提交于 2019-12-10 11:38:49

问题


In my window forms application, I create a Appdomain say sandBox. In this sandbox i excute some code Say TestMethod from TestAppdomain Class. This class is in Test.dll which is not loaded in the current appdomain (Default appdomain).

Now while executing TestMethod some exception occurs, then I want the sandbox domain to be unloaded and since AppDOmain provide Isolotion my Default Appdomain shoud not be affected.

But As i read over the internet i guess this is not possible.But could some one give me some pointer on how to achive it.

Thanks in Advance

Vikram


回答1:


Yes this is certainly possible, and in fact it is the entire purpose of AppDomains. A quick Google search turns up a good resource:

http://geekswithblogs.net/elinden/archive/2008/09/12/application-processing-isolation-welcome-the-appdomain-object.aspx

Above link is broken, this one provides an overview of AppDomain sharing.

http://geekswithblogs.net/akraus1/archive/2012/07/25/150301.aspx

You may also want to look into the Managed Add-In Framework (MAF):



来源:https://stackoverflow.com/questions/3178872/how-do-appdomain-provide-isolation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!