Print All Assemblies In AppDomain : AppDomain : Assembly C# Examples


C# Examples » Assembly » AppDomain »

 

Print All Assemblies In AppDomain









    
using  System;
using  System.Reflection;
using  System.Windows.Forms;
    
public  class  MainClass
{
    public  static  int  Main(string[]  args)
    {
        AppDomain  defaultAD  =  AppDomain.CurrentDomain;
        Console.WriteLine("This  call  loaded  System.Windows.Forms.dll  and  System.dll");

        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

This call loaded System.Windows.Forms.dll and System.dll
Here are the assemblies loaded in main.exe

-> Name: mscorlib
-> Version: 2.0.0.0

-> Name: main
-> Version: 0.0.0.0


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Assembly
» AppDomain