.net core equivalent for GetCustomAttribute on assembly?

自古美人都是妖i 提交于 2020-01-25 06:51:30

问题


I cannot find a .net core equivalent for calling GetCustomAttributes on an assembly object. I see there is CustomAttributes property, but this doesn't return instances of the custom attributes, but rather metadata about the attributes. How can I retrieve the actual attribute instance?


回答1:


There's a GetCustomAttributes extension method. Just add using System.Reflection.



来源:https://stackoverflow.com/questions/38263244/net-core-equivalent-for-getcustomattribute-on-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!