Reading Assembly Attributes
suggest changeUsing .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}");
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents