Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

SmartInspect kill another PostSharp aspects


Hi there!
My company evaluating SmartInspect. And for some reasons when we apply attributes:

[SiTrace(SessionPolicy = SessionPolicy.TypeName, Level = Level.Verbose, IncludeArguments = false, IncludeReturnValue = false, IncludeSpecialNames = false)]

on our services, all another aspects stop working. PostSharp stops compile whole assembly with this error:

[quote]Error 28 Cannot apply aspects to the type [assembly].PerfCounters.InstrumentAverageTimeAttribute because it is itself an aspect. [path]

such error appear for each performance counter aspect in the assembly. Even on those, which not applied directly, but their descendants applied.


The solution is to move attribute SiException from whole assembly

to every single class/method you need

[SiException(SessionPolicy = SessionPolicy.TypeName)] public class Foo { }


Hello Tim,

Thanks for your posting. We’ve already answered this via email. As suspected, when you apply the SmartInspect aspect to the whole assembly, you would also apply it to your own aspects which does not seem to supported with PostSharp.

I hope this helps.