using System;

namespace AppDomainEx
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	class Class1
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		public static int Main(string[] argv) 
		{
			// create domain
			AppDomain child = AppDomain.CreateDomain("dom2");
			// execute yourapp.exe
			int r = child.ExecuteAssembly("yourapp.exe", null, argv);
			// unload domain
			AppDomain.Unload(child);
			return r;
		}
	}
}
