Application Domain in c#

Application Domain Contains One or More Application .

Application Domain Represent ,Which  is an Isolation Environment  where Applications Execute .


static 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);
}


Application domains have the following properties:
  • An assembly must be loaded into an application domain before it can be executed. For more information, see Assemblies and the Global Assembly Cache (C# Programming Guide).
  • Faults in one application domain cannot affect other code running in another application domain.
  • Individual applications can be stopped and code unloaded without stopping the entire process. You cannot unload individual assemblies or types, only entire application domains.



Comments