Migration FxCop custom rules to work with .NET 2.0

I’ve had a bunch of libraries of custom rules that we’ve been using with FxCop against .NET 1.x code. I’ve just gone through the process of recompiling those rules to work against .NET 2.0 assemblies, both using VS 2005 integration with code analysis and the external FxCop 1.35 GUI. Here are my findings on the process:
 
  1. I didn’t have to anything on the code for the rules (seems like the introspection engine hasn’t changed).
  2. In order to use the custom rules within the VS 2005 IDE, the rule assemblies must be copied under the following directory: C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\Rules.
  3. Note that if you’re using the rules within VS 2005, the rule assembly must be compiled against the FxCopSdk.dll and Microsoft.Cci.dll that come with VS 2005 (they’re under C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\). If you’re using the rules from FxCop external GUI instead, the rule assemblies must be compiled against FxCopSdk.dll and Microsoft.Cci.dll that come with FxCop (under some folder like this: C:\Program Files\Microsoft FxCop 1.35).

At this point, I might say I like the integration of code analysis into the VS IDE. However, I still like the way FxCop GUI displays the violations better (better way to see information about the violations, as well as notes typed in by the developers).

See more on the differences between FxCop and VS 2005 on the following posts:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=300185&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=299899&SiteID=1

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: