N
nick_nw
Working with this example:
void foo ()
{
// Create the AppDomain
AppDomain newDomain = AppDomain.CreateDomain("newDomain", null, null);
TestNS.Test testInstance =
(TestNS.Test)newDomain.CreateInstanceFromAndUnwrap
(@"C:\Test\bin\Debug\Test.dll", "TestNS.Test");
// Call a test method in the object created
bool r = testInstance.Test ();
// Unload the appdomain
appDomain.Unload(newDomain);
}
Givent the above, when I call testInstance.Test () which appdomain will
it run in? Will it run in the newDomain domain?
What I'm ultimately aiming to do is run the same assmebly code
concurrently in different app domains. Is the above the right start?
In order to use the object returned by CreateInstanceFromAndUnwrap I
had to add a reference to the DLL so that I had type information
available. Could I achieve this without addinga reference, e.g.
through reflection?
P.S. I wasn't sure which group to post in. If this is no the best
group then apologies in advance.
Regards,
Nick
void foo ()
{
// Create the AppDomain
AppDomain newDomain = AppDomain.CreateDomain("newDomain", null, null);
TestNS.Test testInstance =
(TestNS.Test)newDomain.CreateInstanceFromAndUnwrap
(@"C:\Test\bin\Debug\Test.dll", "TestNS.Test");
// Call a test method in the object created
bool r = testInstance.Test ();
// Unload the appdomain
appDomain.Unload(newDomain);
}
Givent the above, when I call testInstance.Test () which appdomain will
it run in? Will it run in the newDomain domain?
What I'm ultimately aiming to do is run the same assmebly code
concurrently in different app domains. Is the above the right start?
In order to use the object returned by CreateInstanceFromAndUnwrap I
had to add a reference to the DLL so that I had type information
available. Could I achieve this without addinga reference, e.g.
through reflection?
P.S. I wasn't sure which group to post in. If this is no the best
group then apologies in advance.
Regards,
Nick