PostSharp on assemblies I don't have source for

前端 未结 1 856
执笔经年
执笔经年 2020-12-18 02:21

In the examples on their website, PostSharp has a demo of intercepting calls in main system assemblies. I have tried a few times to setup and replicate said intercept calls

相关标签:
1条回答
  • 2020-12-18 03:02

    You can trace methods of other assemblies by specifying:

    [assembly: Trace("MyCategory",
                     AttributeTargetAssemblies="xyz",
                     AttributeTargetTypes = "My.BusinessLayer.*")]
    

    However, the external assembly will not be modified! Only calls from the current project to the external assembly can be modified.

    It is currently not easy to modify assemblies you don't have the source of. This is possible, but is considered an advanced scenario and requires custom coding.

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