Sunday, October 01, 2006

.NET Framework Application Domain

@ How to create an Application Domain?
@ To create an AppDomain, call static AppDomain.CreateDomain("YourAppDomain") method.
@ To load an assembly in an application domain, call AppDomain.ExecuteAssembly("TheAssemblyName.exe") method.
@ To unload an application domain, call static AppDomain.Unload(YourAppDomainReference) method.

Dim OneAppDomain As AppDomain = AppDomain.CreateDomain("MyFirstDomain")
Console.WriteLine(" Host domain: " + AppDomain.CurrentDomain.FriendlyName)
Console.WriteLine("Child domain: " + OneAppDomain.FriendlyName)

@ Create an application domain anytime you want to launch an assembly.