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

PostSharp Smart Inspect Aspect Sample Does Not Work


#1

Hi,

I’ve build the smart inspect with postsharp sample (2.0, HelloWorldVS2010.sln) in VS 2015 with .net 4.6.1. Applications runs and I’m logging to a sil file specified by SiAuto.Si.Connections. When loaded into Smart Inspect’s Console app, only the “SiAuto.Main.LogMessage” are captured and nothing else.

Hello, World.
Goodbye, World.
Hello, Hello World.

I was expecting to see method entry and variables logged as Program.cs contains the following:

[assembly:SiTrace(SessionPolicy = SessionPolicy.TypeName,
IncludeArguments = true,
IncludeReturnValue = true,
IncludeSpecialNames = true)]
[assembly:SiException(SessionPolicy = SessionPolicy.TypeName)]
[assembly:SiField(SessionPolicy = SessionPolicy.TypeName)]

What am I missing here?

Thanks!


#2

Hey Rays,

Thanks for your posting. The PostSharp plugin/example is for a quite old PostSharp version so I’m not sure if this would still apply to current PostSharp and/or .NET versions. I’m sure PostSharp has some current examples on adding logging to applications using aspects and you can usually use SmartInspect as a drop-in replacement for other logging frameworks, or use SmartInspect in combination with the debug/trace listener interface.

I hope this helps!

Cheers,
Tobias