我们正在使用SonarQube 5.1和最新的 MSBuild Sonar Runner C# 插件 4.2。
在启用 FxCop 规则的情况下运行分析时,我们的原因是:
java.lang.IllegalArgumentException: The property "sonar.cs.fxcop.assembly" must be set and the project must have been built to execute
FxCop rules. This property can be automatically set by the Analysis Bootstrapper for Visual Studio Projects pl
ugin, see: http://docs.codehaus.org/x/TAA1Dg. If you wish to skip the analysis of not built projects, set the property
"sonar.visualstudio.skipIfNotBuilt".
这是sonar.project.properties:
# Project identification
sonar.projectKey=TestSonar
sonar.projectVersion=1.0-SNAPSHOT
sonar.projectName=TestSonar
#Core C# Settings
sonar.silverlight.4.mscorlib.location=C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Silverlight/v5.0
#UnitTests
sonar.cs.vstest.reportsPaths=TestSonar_UnitTests/*.trx
#CodeCoverage
#sonar.cs.vscoveragexml.reportsPaths = C:\Users\sabharadwaj\Documents\Visual Studio 2013\Projects\TestSonar\TestSonar_UnitTests\VS2013_TestSonar.coveragexml
sonar.cs.opencover.reportPaths=C:\Users\sabharadwaj\Documents\Visual Studio 2013\Projects\TestSonar\TestSonar_UnitTests\VS2013_TestSonar.coveragexml
#FxCop
sonar.cs.fxcop.assembly=C:\Users\sabharadwaj\Documents\Visual Studio 2013\Projects\TestSonar
sonar.cs.fxcop.fxCopCmdPath=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe