Assembly.GetName : Assembly « System.Reflection « C# / C Sharp by API






Assembly.GetName

   
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;
  }
}

   
    
    
  








Related examples in the same category

1.Assembly.CodeBase
2.Assembly.EntryPoint
3.Assembly.EscapedCodeBase
4.Assembly.Evidence
5.Assembly.FullName
6.Assembly.GetCallingAssembly()
7.Assembly.GetCustomAttributes
8.Assembly.GetEntryAssembly()
9.Assembly.GetExecutingAssembly()
10.Assembly.GetExportedTypes
11.Assembly.GetReferencedAssemblies
12.Assembly.GetTypes()
13.Assembly.GlobalAssemblyCache
14.Assembly.Load(AssemblyName name2)
15.Assembly.Load(String name)
16.Assembly.LoadFrom(String assemblyName)
17.Assembly.Location