AppDomain ad = AppDomain.CreateDomain("NewDomain"); ObjectHandle objHandle = ad.CreateInstance("MyAssemblyName", "MyNamespace.MyType"); MyType obj = (MyType) objHandle.Unwrap();
AppDomain ad = AppDomain.CreateDomain("NewDomain"); Assembly asm = ad.Load("MyAssemblyName"); Type type = asm.GetType("MyNamespace.MyType"); MyType obj = (MyType) Activator.CreateInstance(type);This example creates a new application domain called "NewDomain" and uses the Load method to load the MyAssemblyName assembly. It then uses GetType to get the Type of the desired class and uses the Activator.CreateInstance method to create an instance of the class. Both examples above use the System namespace in C#.