An interesting post of David DeWinter showing how difficult it is to use FxCop/VSTS Code Analysis when PostSharp is enabled. Indeed, PostSharp does not respect all FxCop rules, and does not emit rule-disabling custom attributes.

David shows how to run FxCop before PostSharp, which involves some serious changes in MSBuild files.

Seems like a worry for the next version of PostSharp...

Comments (3) -

David DeWinter
David DeWinter
2/13/2008 5:33:00 PM #

Hi Gael,

I just recently stumbled across your blog and found that you referenced my post. You say that this could be a worry for the next version of PostSharp; is it something you will be looking into for the next version of PostSharp?

Perhaps there is a way for PostSharp to emit an intermediate assembly that serves as the target of Code Analysis. That would definitely help those individuals using FxCop instead of VS to perform code analysis.

David DeWinter

P.S. The actual link to the blog entry is here:

Gael Fraiteur
Gael Fraiteur
2/13/2008 5:40:00 PM #

Hi David,

I have filed (myself) a 'feature request' in the issue tracker and it will be in the current release (1.0).

I will at least put the [CompilerGenerated] custom attribute on all stuff generated by Laos, so static analyzers are supposed to ignore it.

So it is for very soon!


David DeWinter
David DeWinter
2/14/2008 7:30:00 AM #

Even better! Good luck!


Comments are closed