Search

Display Assembly attributes

This C# code snippet displays a list of all the Assembly attributes contained in an assembly file.

using System.Reflection;
 
// Change the LoadFrom argument to point to your assembly file
Assembly assembly  = 
   Assembly.LoadFrom (@"C:\Documents\ClassLibrary.dll");
object[] attibutes = assembly.GetCustomAttributes (true);
if (attibutes .Length > 0)
   {
   Console.WriteLine ("Assembly attributes for '{0}'", assembly );
   foreach (object o in attibutes) {
      Console.WriteLine ("Attribute: {0}", o.ToString());
   }