Mega Code Archive

 
Categories / C# / Reflection
 

Load and execute an assembly and Unload the application domain

public class MainClass{     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);     } }