C# Language Reading Assembly Attributes


Example

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