Can attributes be added dynamically in C#?

后端 未结 10 826
别跟我提以往
别跟我提以往 2020-11-22 14:32

Is it possible to add attributes at runtime or to change the value of an attribute at runtime?

10条回答
  •  失恋的感觉
    2020-11-22 15:02

    Well, just to be different, I found an article that references using Reflection.Emit to do so.

    Here's the link: http://www.codeproject.com/KB/cs/dotnetattributes.aspx , you will also want to look into some of the comments at the bottom of the article, because possible approaches are discussed.

提交回复
热议问题