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