Navigation


RSS: subscribe



PostSharp & Code Analysis

Wednesday, January 16, 2008 posted by Gael Fraiteur

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...

3 Comments:

Anonymous David DeWinter said...

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.

Regards,
David DeWinter

P.S. The actual link to the blog entry is here: http://blogs.rev-net.com/ddewinter/?p=30

February 13, 2008 3:33:00 PM CET  
Blogger Gael Fraiteur said...

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!

Gael

February 13, 2008 3:40:00 PM CET  
Anonymous David DeWinter said...

Even better! Good luck!

David

February 14, 2008 5:30:00 AM CET  

Post a Comment

Links to this post:

Create a Link