Reading Assembly Attributes

suggest change

Using .NET’s rich reflection APIs, you can gain access to an assembly’s metadata. For example, you can get this assembly’s title attribute with the following code

using System.Linq;
using System.Reflection;

...

Assembly assembly = typeof(this).Assembly;
var titleAttribute = assembly.GetCustomAttributes<AssemblyTitleAttribute>().FirstOrDefault();

Console.WriteLine($"This assembly title is {titleAttribute?.Title}");

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents