.net 核心相当于 GetCustomAttribute 在程序集上?
.net core equivalent for GetCustomAttribute on assembly?
我找不到在程序集对象上调用 GetCustomAttributes 的 .net 核心等效项。我看到有 CustomAttributes 属性,但这不是自定义属性的 return 实例,而是关于属性的元数据。如何检索实际的属性实例?
有一个 GetCustomAttributes
扩展方法。只需添加 using System.Reflection
.
我找不到在程序集对象上调用 GetCustomAttributes 的 .net 核心等效项。我看到有 CustomAttributes 属性,但这不是自定义属性的 return 实例,而是关于属性的元数据。如何检索实际的属性实例?
有一个 GetCustomAttributes
扩展方法。只需添加 using System.Reflection
.