Jan 24, 2011

How To Use VS2010 Code Analysis Rules and Localization Resources in FxCop 10.0

I learned VS2010 Pro contains static code analysis rules and the stand-alone FxCop 10.0 can use them (thanks @Pedro).

By default, VS2010 code analysis rules were installed in %PROGRAMFILES%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\Rules. If you copy assemblies in this directory to FxCop Rules directory (%PROGRAMFILES%\Microsoft FxCop 10.0\Rules by default), FxCop can detect VS2010 code analysis rules.

But, what good is it?

The stand-alone FxCop doesn't contain Maintainability and Reliability rules. Thus, this technique allows you to use them in FxCop.

Additionally, localization resources are also contained in %PROGRAMFILES%\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop. For example, VS2010 Pro Japanese Edition has ja directory in the above directory. If you copy this one to FxCop Rules directory, you can localize rule list of FxCop GUI and FxCopCmd output messages.

Localized FxCop GUI


No comments:

Post a Comment