Nov 28, 2011

FxCop Integrator 2.0.0 RC Released

In Nov 27 2011, I released FxCop Integrator 2.0.0 RC. You can download it from CodePlex project site.

The 2.0.0 RC contains following new features.



Provides MSBuild tasks

I implemented MSBuild custom tasks to execute code inspection and code metrics calculation. These MSBuild tasks work the same as FxCop Integrator’s on-demand execution.

You can install MSBuild tasks with the msi installer not VSIX. So, you can install them to the machine that doesn’t have Visual Studio (e.g. CI server).


The MSBuild tasks installer creates %PROGRAMFILES%\MSBuild\FxCop Integrator\FxCopIntegrator.targets. When you add

<Import Project="$(PROGRAMFILES)\MSBuild\FxCop Integrator\FxCopIntegrator.targets" />

to the project file and specify

/p:FxCopCmdPath=”the path of FxCopCmd.exe” /p:EnableCodeInspectionOnBuild=true

as MSBuild command line parameter, MSBuild executes code inspection after build.

FYI, when you specify following command line parameter, MSBuild executes code metrics calculation after build.

/p:MetricsPath=”the path of Metrics.exe” /p:EnableCodeMetricsCalculationOnBuild=true


The internal specification of the “Code Analysis on Build” feature was changed.

In 2.0.0 Beta 2 or before, the specification of this feature is

  1. When the FxCop Integrator extension is loaded, it generates “CodeAnalysis.exe” that can analyze code the same as FxCop Integrator’s on-demand execution.
  2. When user enable '”Code Analysis on Build”, FxCop Integrator changes a project file to add the Exec MSBuild task to execute CodeAnalysis.exe into the “AfterBuild” target.

But 2.0.0 RC or later,

  1. When user install FxCop Integrator MSBuild tasks and enable “Code Inspection on Build”, FxCop Integrator changes a project file to import the above targets file and to add the EnableCodeInspectionOnBuild property.

For backward compatibility, you can still use the old style “Code Analysis on Build” feature, but it will be deprecated in the future release.



Warning Filtering Feature

I implemented the warning filtering feature to filter out warnings against the code that is defined in a designer file or an auto-generated file.

You can define filtering patterns with the code analysis configuration editor.




By default, FxCop Integrator defines filtering patterns to filter out designer code (e.g. *.Designer.cs, etc) and auto-generated code (e.g. *.generated.cs, *.g.cs, etc).

Nov 13, 2011

FxCop Integrator 2.0.0 Beta 2 Released

In Nov 11 2011, I released FxCop Integrator 2.0.0 Beta 2. You can download it from CodePlex project site.

FxCop Integrator is a Visual Studio 2010 extension that integrates FxCop to VS2010 and makes it easy to execute FxCop like VS2010 Premium/Ultimate. It also supports to filter code analysis results and shows the FxCop rule detail.

Version 2.0.0 supports to execute Metrics.exe (Visual Studio Code Metrics Power Tools 10.0) and provides some new features.



Visual Studio Code Metrics Power Tools 10.0 Integration

FxCop Integrator 2.0.0 supports to integrate Visual Studio Code Metrics Power Tools 10.0. You can easily execute Metrics.exe on the Solution Explorer.



When you execute code metrics calculation, FxCop Integrator shows calculation result as below.



Because FxCop Integrator supports FxCop and Metrics, I added some menus for executing code analysis.

  • [Code Analysis] : Execute both FxCop and Metrics.
  • [More Tasks…] > [Inspect XXX] : Execute FxCop only. 
  • [More Tasks…] > [Calculate Metrics] : Execute Metrics only.


But if you don’t want to use Metrics, you can change the [Code Analysis] menu behavior from option page.




Multi-Project Analysis, File Level Analysis

FxCop Integrator 1.X only supported to analyze all projects in a solution or a single project. But 2.0.0 supports to analyze selected multi-project.



Also you can analyze only some types that are defined in the specified file. This feature can be used when the language of source code is C# or VB.NET. And, this doesn’t support code metrics calculation.




Message Suppression

The Suppress Message is added in the Rule Detail window to let developers more easily add a “SuppressMessage” attribute into the code.




Export Code Analysis Result

The [Export] menu is added in the Code Inspection Result window and the Code Metrics Calculation Result window. You can export code analysis result as CSV.




And more improvements and bug fixes.


I’ll release FxCop Integrator 2.0.0 RTW in late November or early December.