C# 如何访问通用Windows应用程序中的程序集属性?
我试图从程序集的一些属性中获取值,例如各种版本属性加上一些自定义属性 当我尝试访问C# 如何访问通用Windows应用程序中的程序集属性?,c#,attributes,uwp,C#,Attributes,Uwp,我试图从程序集的一些属性中获取值,例如各种版本属性加上一些自定义属性 当我尝试访问Assembly.getExecutionGassembly()时,它不见了System.Reflection.Assembly似乎只有一个方法,Load() 那么如何访问属性值呢?我知道在WinRT中检索程序集的唯一方法是通过GetTypeInfo扩展方法。它在命名空间系统中定义。反射: using System.Reflection; ... foreach (var attribute i
Assembly.getExecutionGassembly()
时,它不见了System.Reflection.Assembly
似乎只有一个方法,Load()
那么如何访问属性值呢?我知道在WinRT中检索程序集的唯一方法是通过
GetTypeInfo
扩展方法。它在命名空间系统中定义。反射:
using System.Reflection;
...
foreach (var attribute in this.GetType().GetTypeInfo().Assembly.CustomAttributes)
{
Debug.WriteLine(attribute);
}
我知道在WinRT中检索程序集的唯一方法是通过GetTypeInfo
扩展方法。它在命名空间系统中定义。反射:
using System.Reflection;
...
foreach (var attribute in this.GetType().GetTypeInfo().Assembly.CustomAttributes)
{
Debug.WriteLine(attribute);
}