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
- When the FxCop Integrator extension is loaded, it generates “CodeAnalysis.exe” that can analyze code the same as FxCop Integrator’s on-demand execution.
- 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,
- 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).