PostSharp属性未继承

时间:2012-03-30 16:35:26

标签: c# postsharp aop

我在PostSharp中创建了一个类型级方面,它添加了一些方法预处理。我已经将它应用到课堂上,它的工作方式与宣传的一样。但是,在从那个派生的类中,它没有 - 方法入口代码没有被命中。

如何使我的方面可以继承?

我尝试将[AttributeUsage(AttributeTargets.Class, Inherited=true)]添加到方面类 - 没有效果。

1 个答案:

答案 0 :(得分:1)

您需要设置AttributeInheritance = MulticastInheritance.Multicast

在文档

中阅读更多相关信息

Mulicast Attribute (Aspect) inheritance