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






Assembly.GetExportedTypes

  
  
using System;
using System.Reflection;

public class MainClass
{
  static void Main(string[] args)
  {
    Assembly XMLAssembly;
    Type[] XMLTypes;

    XMLAssembly = Assembly.Load("System.Xml, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
    XMLTypes = XMLAssembly.GetExportedTypes();
    foreach(Type XMLType in XMLTypes)
    {
      object NewObject;

      Console.Write(XMLType.ToString());
      NewObject = XMLAssembly.CreateInstance(XMLType.ToString());
      if(NewObject != null)
        Console.WriteLine(" - Creation successful");
      else
        Console.WriteLine(" - CREATION ERROR");
    }
  }
}

 

   
    
  








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.GetName
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