I am trying to modify the sample trace app that ships with Postsharp so that the trace is applied to all classes in my namespace without explicitly putting the [QuickTrace] on top of each class. I have attached a screenshot. What am I doing wrong ? Right click open/view image for bigger picture. thank you
You're doing it incorrectly. You're trying to assign the aspects to the mscorelib which will wrap calls to any methods that reside in the mscorelib (not your current app) but you're negating that with the fact tyhat you're telling it to apply to methods only in the Trace namespace.
Just use
[assembly: QuickTrace()]
Done. On your aspect, add the following
[QuickTrace(AttributeExclude=True)]
[Serializable]
public QuickTrace : OnMethodBoundaryAspect
{
//..Aspect code here
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With