How to access assembly attributes in a universal Windows application?

I am trying to get values ​​from some attributes of an assembly, such as various version attributes, as well as some user attributes.

When I try to access Assembly.GetExecutingAssembly(), he is gone! System.Reflection.Assemblyseems to have only one method Load().

So how do I access my attribute values?

0
source share
1 answer

The only way I know in WinRT to get the assembly is with the extension method GetTypeInfo. It is defined in the namespace System.Reflection:

using System.Reflection;

...

        foreach (var attribute in this.GetType().GetTypeInfo().Assembly.CustomAttributes)
        {
            Debug.WriteLine(attribute);
        }
+4
source

Source: https://habr.com/ru/post/1615067/


All Articles