开发者

How to set Host's Domain Manager in a created AppDomain

开发者 https://www.devze.com 2023-01-11 18:01 出处:网络
I am not sure if this is possible but I would want something similar to loading the Host\'s domain manager to my new AppDomain. There is no Domain Manager for a newly created AppDomain. Owing to this

I am not sure if this is possible but I would want something similar to loading the Host's domain manager to my new AppDomain. There is no Domain Manager for a newly created AppDomain. Owing to this many of my subsequent call fails.

For example if I m开发者_StackOverflowake a call to "Assembly.GetEntryAssembly" it returns null in the new AppDomain. To workaround this I will have to call "AppDomain.ExecuteAssembly("entryassembly")" in my created AppDomain. I actually do not have a need to do this in my application.

Similarly there are other calls such as "ScriptEngine.GetSearchPaths". This again does not return the expected search paths in my new AppDomain. Again if I perform "AppDomain.ExecuteAssembly("entryassembly")" then the expected search path is returned.

So in short a domain manager is created in my new AppDomain only when i execute the entry assembly in my new AppDomain; which internally provides me a domain manager similar to the Host's domain Manager (as i execute the same entry assembly). Is there a way to load the Host's domain manager without executing any assembly in my new AppDomain.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号