开发者

Loading an Isolated dll into existing Appdomain and autoexecuting events

开发者 https://www.devze.com 2022-12-29 11:40 出处:网络
I have a solutions where three projects are running. One of my project is class library that is isolated from other two class. Now what I want to do is to load it into existing appdomain and auto exec

I have a solutions where three projects are running. One of my project is class library that is isolated from other two class. Now what I want to do is to load it into existing appdomain and auto execute its methods on some event occured from other assemblies in same domain.

I have an event inside that, and i want to execute that event

Is it possible? I not getting the way to autoexecute an. While googling I fouund AppDomain.CreateInstance () but not able to fully utilise it.

OR

Way to trap events occuring in APPDOMAIN. Since i have my dll loaded in domain so how can I trap events occuring ins开发者_JAVA百科ide a domain.


It's reasonably straight forward, this should get you going: http://msdn.microsoft.com/en-us/library/ms173139(VS.80).aspx

Basically you need to create an object that inherits from MarshalByRefObject, then pass an instance of it to the parent Appdomain. You now have an object running in your appdomain that you can manipulate, be it attaching or raising events, calling methods, whatever.

0

精彩评论

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

关注公众号