Assembly.Load duplicates the Assembly when loaded into a new AppDomain

谁说胖子不能爱 提交于 2019-12-25 14:39:16

问题


I currently have a problem where if I set up a new App Domain and use AppDomain.Load, The Assembly gets loaded twice (Once into the new App Domain, and once into the default App Domain)

The code I am using to load the Assembly is as follows:

AppDomain dom = AppDomain.CreateDomain(_dllname);

                AssemblyName assemblyName = new AssemblyName();
                assemblyName.CodeBase = directory + _dllname;

                Assembly a = dom.Load(assemblyName);

When I use this code the Assembly loads correctly into my new AppDomain (with the same name as the dll) but for some reason, always loads into the default AppDomain (in this occasion, IQUS_Main.vshost.exe)

Here is a screenshot of the issue, immediately after the dom.Load line:

来源:https://stackoverflow.com/questions/40213755/assembly-load-duplicates-the-assembly-when-loaded-into-a-new-appdomain

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