PostSharp OnMethodBoundaryAspect

Posted by José F. Romaniello on Stack Overflow See other posts from Stack Overflow or by José F. Romaniello
Published on 2010-03-24T11:32:21Z Indexed on 2010/03/24 11:33 UTC
Read the original article Hit count: 699

Filed under:

I'm working on an aspect with postsharp 1.5 and OnMethodBoundaryAspect. I want my aspect have the following behavior by default:

1-If the attribute is used at class level the aspect is applied only on PUBLIC methods.

2-The user of the aspect can put the aspect in a private or protected method.

If I use this [MulticastAttributeUsage( MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Public)] the point 1 works, but the case 2 doesn't even build becaue is incompatible.

Then I tried to use: AttributeTargetTypeAttributes = MulticastAttributes.Public; in the constructor of the aspect, but doesn't work.

Thank you very much in advance.

© Stack Overflow or respective owner

Related posts about postsharp