I have created a new AppDomain from within my window Service.
I need to pass some delegates to an instance of a class loaded in the other
appDomain.
With the way I currently do it, the delegates get called. HOWEVER, in the
second appDomain and not
in my main AppDomain.
The class that contains the delegates is derived from MarshalByRefObj ect.
Heeeeeelp!
Thanks :-)
========Snippet of my code =============
// ...
AppDomain gAppDomain;
gAppDomain = AppDomain.Creat eDomain ("FileAcquistio nRamitAppDomain ", null,
setup);
Object o = gAppDomain.Crea teInstanceAndUn wrap(
Assembly.GetExe cutingAssembly( ).FullName,
typeof(RamitRec eiveWrapper).Fu llName);
// local object to access object located in other AppDomain
RamitWrapperApp Domain = (FileAcquisitio n.RamitReceiveW rapper)o;
//
// initialize callbacks for customized treatments /// <----- here I pass
my delegates
//
gcbProcImg = new RamitReceiveWra pper.FProcImg(F ileReceiver.Sto reImage);
gcbExitRamit = new RamitReceiveWra pper.FExitRamit (FileReceiver.E xitRamit);
RamitWrapperApp Domain.DefineRa mitDelegates(re f gcbProcImg, ref
gcbExitRamit);
//...
I need to pass some delegates to an instance of a class loaded in the other
appDomain.
With the way I currently do it, the delegates get called. HOWEVER, in the
second appDomain and not
in my main AppDomain.
The class that contains the delegates is derived from MarshalByRefObj ect.
Heeeeeelp!
Thanks :-)
========Snippet of my code =============
// ...
AppDomain gAppDomain;
gAppDomain = AppDomain.Creat eDomain ("FileAcquistio nRamitAppDomain ", null,
setup);
Object o = gAppDomain.Crea teInstanceAndUn wrap(
Assembly.GetExe cutingAssembly( ).FullName,
typeof(RamitRec eiveWrapper).Fu llName);
// local object to access object located in other AppDomain
RamitWrapperApp Domain = (FileAcquisitio n.RamitReceiveW rapper)o;
//
// initialize callbacks for customized treatments /// <----- here I pass
my delegates
//
gcbProcImg = new RamitReceiveWra pper.FProcImg(F ileReceiver.Sto reImage);
gcbExitRamit = new RamitReceiveWra pper.FExitRamit (FileReceiver.E xitRamit);
RamitWrapperApp Domain.DefineRa mitDelegates(re f gcbProcImg, ref
gcbExitRamit);
//...
Comment