PostSharp & Code Analysis

by Gael Fraiteur, 16 January 2008

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

2/13/2008 11:33:00 AM #

David DeWinter

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

David DeWinter | Reply

2/13/2008 11:40:00 AM #

Gael Fraiteur

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

Gael Fraiteur | Reply

2/14/2008 1:30:00 AM #

David DeWinter

Even better! Good luck!

David

David DeWinter | Reply

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading