Postsharp: how does it work?

后端 未结 2 537
猫巷女王i
猫巷女王i 2021-01-06 11:10

Following the advice got on another question of mine, I converted the code there quoted to be used with PostSharp:

Attribute:

[Serializable]
public s         


        
相关标签:
2条回答
  • 2021-01-06 11:24

    PostSharp processes the compiled IL binary and adds action you want to the method body decorated with the attribute. The attribute won't do anything by itself. This is how CLR tends to work. It just treats attributes as data, not executable code. Without running PostSharp on the compiled code, you don't get anything special.

    0 讨论(0)
  • 2021-01-06 11:24

    You do not need to execute the PostSharp command-line utility, but you need to install properly.

    The easiest way is to install PostSharp using the installer.

    Otherwise, you should edit your project file using a text editor as described in documentation.

    0 讨论(0)
提交回复
热议问题