The tool which generates rules configuration xml for give FxCop assemblies
- you need to have FxCop installed
- open the solution file in Visual Studio 2012
- check the project references and correct them if necessary.
- FxCopCommon.dll and FxCopSdk.dll are located in %fxcop_home%\FxCopCommon.dll
Note: %fxcop_home% is usually "c:\Program Files (x86)\Microsoft Fxcop 10.0" on 64b OS and "c:\Program Files\Microsoft Fxcop 10.0" on 32b OS
- execute
SonarFxCopRulesGenerator.exe "%fxcop_home%\rules" YourOutputFile.xml
- execute:
SonarFxCopRulesGenerator.exe "%location_of_your_assemblies%\rules" YourOutputFile.xml
- copy phx.dll and Microsoft.VisualStudio.CodeAnalysis.Phoenix.dll from "%vs_static_analysis_home%\FxCop" to the folder where your SonarFxCopRulesGenerator.exe is located
- execute:
SonarFxCopRulesGenerator.exe "%vs_statis_analysis_home%\FxCop\rules" YoutOutputFile.xml
Note:
%vs_static_analysis_home% is usually "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools" on 64b OS and "c:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools" on 32b OS
Note:
Visual Studio Static Analysis contains all standard FxCop rules. If you only want to generate an XML file for the rules which are not in FxCop, run the tool with DataFlowRules.dll, MaintainabilityRules.dll and ReliabilityRules.dll assemblies only.
- copy Microsoft.VisualStudio.CodeAnalysis.DataflowModels.dll, Microsoft.VisualStudio.CodeAnalysis.Phoenix.dll and phx.dll from %vs_static_analysis_home% to %fxcop_home%
- copy PhoenixAnalysisEngine.dll from %vs_static_analysis_home%\Engines to %fxcop_home%\Engines
- copy DataFlowRules.dll, MaintainabilityRules.dll and ReliabilityRules.dll rom %vs_static_analysis_home%\Rules to %fxcop_home%\Rules
- place the configuration files you generated to %sonar_home%\extensions\rules\fxcop
- restart sonar