How To Create Application Domain and load a assembly?

2 views
Skip to first unread message

.NetIndia

unread,
Oct 14, 2005, 4:39:39 AM10/14/05
to dotNetIndia
How To Create Application Domain and load a assembly?
 
Post ur answers here...

--
Regards,
.NetIndia Group,
"There is no delight in owning anything unshared."
"A book lying idle on a shelf is wasted ammunition. Like money, books must be kept in constant circulation. Lend and borrow to the maximum -- of both books and money! But especially books, for books represent infinitely more than money. A book is not only a friend, it makes friends for you. When you have possessed a book with mind and spirit, you are enriched. But when you pass it on you are enriched threefold."

Blog:http://dotnetindia.blogspot.com/
 

BabuLives

unread,
Oct 15, 2005, 2:26:53 AM10/15/05
to .NetIndia
hai groups..

Application Domains provides a way to run multiple application within a
same process,it provides isolation between application so that one
application wont affect the other.ie when a server has 2 Websites
running,it can run those two websites inside the same worker
process(aspnet_wp.exe) but in different application domain.


Advantages:
Secure
Isolation of application
Increaes the server scalability
Faults in one website cannot affect other
Individual applications can be stopped and code unloaded without
stopping the entire process.


In the following code example, you create a new application domain and
then load and execute a previously built assembly, HelloWorld.exe, that
is stored on drive C.

C# Copy Codestatic void Main()
{
// Create an Application Domain:
System.AppDomain newDomain =
System.AppDomain.CreateDomain("NewApplicationDomain");

// Load and execute an assembly:
newDomain.ExecuteAssembly(@"c:\HelloWorld.exe");

// Unload the application domain:
System.AppDomain.Unload(newDomain);
}


Regards,
Satheesh

Reply all
Reply to author
Forward
0 new messages