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