PC Review


Reply
Thread Tools Rate Thread

Run assembly method in another app domain

 
 
nick_nw
Guest
Posts: n/a
 
      5th Apr 2006
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

 
Reply With Quote
 
 
 
 
nick_nw
Guest
Posts: n/a
 
      7th Apr 2006
Hi. Thanks for the reply. In response to your questions and to
clarify things I've started a new post:
http://groups.google.co.uk/group/mic...fe32034a4b7a5a

Many thanks,

Nick

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading assemblies in another domain gets the assembly loaded in the default domain too!?!?!? DeveloperX Microsoft C# .NET 2 11th Jan 2008 02:24 PM
Migrating from multiple child domain environment to single domain with OUs. What's correct method? Sam Munzani Microsoft Windows 2000 Active Directory 5 12th Oct 2007 09:06 PM
Loading assembly Method on Runtime =?Utf-8?B?U3VkaGVl?= Microsoft Dot NET 0 22nd Mar 2006 03:00 PM
Assembly.GetCustomAttributes Method =?Utf-8?B?RWxhZA==?= Microsoft C# .NET 0 1st Dec 2005 05:17 PM
How would I get a method name from the calling assembly? kevingabbert@gmail.com Microsoft Dot NET Framework 1 30th Mar 2005 11:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:26 PM.