okaminer
2008-11-26 07:41:13 UTC
Hi
I know how to create a new AppDomain and send request to that
AppDomain using MarshalByRefObject
But how can I call the hosting AppDomain from the new AppDomain
This is my code code for creating and calling a new AppDomain:
AppDomain newDomain = AppDomain.CreateDomain("NewDomain");
MyClass cls = (MyClass)newDomain.CreateInstanceAndUnwrap
("TestAppDomain", "MyRemoteClass.MyClass");
cls.MyRemoteEvent += new EventHandler(cls_MyRemoteEvent);
cls.DoSomething();
Now the MyClass (cls) do bunch of stuff in the DoSomething function
(where a new thread is created) and every now and then needs to pass
information back to the First AppDomain
so how can I accomplish that?
Thank in advance
I know how to create a new AppDomain and send request to that
AppDomain using MarshalByRefObject
But how can I call the hosting AppDomain from the new AppDomain
This is my code code for creating and calling a new AppDomain:
AppDomain newDomain = AppDomain.CreateDomain("NewDomain");
MyClass cls = (MyClass)newDomain.CreateInstanceAndUnwrap
("TestAppDomain", "MyRemoteClass.MyClass");
cls.MyRemoteEvent += new EventHandler(cls_MyRemoteEvent);
cls.DoSomething();
Now the MyClass (cls) do bunch of stuff in the DoSomething function
(where a new thread is created) and every now and then needs to pass
information back to the First AppDomain
so how can I accomplish that?
Thank in advance