Make a new AppDomain in the current process : AppDomain : Assembly C# Examples


C# Examples » Assembly » AppDomain »

 

Make a new AppDomain in the current process









    
using  System;
using  System.Reflection;
using  System.Windows.Forms;
    
public  class  MainClass
{
    public  static  int  Main(string[]  args)
    {
        AppDomain  defaultAD  =  AppDomain.CreateDomain("SecondAppDomain");

        Assembly[]  loadedAssemblies  =  defaultAD.GetAssemblies();            
        Console.WriteLine("Here  are  the  assemblies  loaded  in  {0}\n",defaultAD.FriendlyName);
        foreach(Assembly  a  in  loadedAssemblies)
        {
            Console.WriteLine("->  Name:  {0}",  a.GetName().Name);
            Console.WriteLine("->  Version:  {0}\n",  a.GetName().Version);
        }

        return  0;
    }
}
    
   
  
   



Output

Here are the assemblies loaded in SecondAppDomain

-> Name: mscorlib
-> Version: 2.0.0.0


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Assembly
» AppDomain