CSharp examples for Custom Type:AppDomain
Execute an Assembly in a Different Application Domain
using System;//from w w w . j a va 2 s . com class MainClass { public static void Main(string[] args) { if (AppDomain.CurrentDomain.FriendlyName != "NewAppDomain") { AppDomain domain = AppDomain.CreateDomain("NewAppDomain"); domain.ExecuteAssembly("Recipe03-06.exe", args); } foreach (string s in args) { Console.WriteLine(AppDomain.CurrentDomain.FriendlyName + " : " + s); } if (AppDomain.CurrentDomain.FriendlyName != "NewAppDomain") { Console.WriteLine("\nMain method complete. Press Enter."); } } }