[assembly: AssemblyTitle("CustAttrs1CS")]
[assembly: AssemblyDescription("GetCustomAttributes() Demo")]
[assembly: AssemblyCompany("ZZZ Projects")]
namespace ExtensionMethods
public static void Main()
Assembly assy = typeof(Program).Assembly;
foreach (Attribute attr in Attribute.GetCustomAttributes(assy))
if (attr.GetType() == typeof(AssemblyTitleAttribute))
Console.WriteLine("Assembly title is \"{0}\".", ((AssemblyTitleAttribute)attr).Title);
else if (attr.GetType() == typeof(AssemblyDescriptionAttribute))
Console.WriteLine("Assembly description is \"{0}\".", ((AssemblyDescriptionAttribute)attr).Description);
else if (attr.GetType() == typeof(AssemblyCompanyAttribute))
Console.WriteLine("Assembly company is {0}.", ((AssemblyCompanyAttribute)attr).Company);