2
votes
SonarQube - V 5.1.1
MSBuild SonarQube Runner - V 1.0
Resharper Plugin - V 2.0
Csharp Plugin - V 4.1

I am running the commands:

    - D:\SonarQube\sonarqube-5.1.1\MSBuild\MSBuild.SonarQube.Runner.exe begin /key:Test6MSBKey /name:Test6MSBProject /version:2.0
    - msbuild Test6MSB.sln
    - D:\SonarQube\sonarqube-5.1.1\MSBuild\MSBuild.SonarQube.Runner.exe end

All of my resharper errors are skipped, with the following issues being logged to the command window:

10:20:11 PM  22:20:11.013 INFO  - Sensor org.sonar.plugins.resharper.CSharpReSharperProvider$CSharpReSharperSensor@1659dbf
10:20:11 PM  22:20:11.013 INFO  - Parsing ReSharper report: D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB.xml
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 15 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 16 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 17 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 18 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 19 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 20 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 21 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Program.cs" is no
t in SonarQube.
10:20:11 PM  22:20:11.054 INFO  - Skipping the ReSharper issue at line 22 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Program.cs" is no
t in SonarQube.
10:20:11 PM  22:20:11.055 INFO  - Skipping the ReSharper issue at line 23 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Properties\Assemb
lyInfo.cs" is not in SonarQube.
10:20:11 PM  22:20:11.055 INFO  - Sensor org.sonar.plugins.resharper.CSharpReSha
rperProvider$CSharpReSharperSensor@1659dbf (done) | time=42ms

I'm not sure why the code files are not being put into SonarQube using the MSBuild Runner. Prior to trying to use the MSBuild runner, I was able to successfully use the sonar-runner.bat(v2.4) on a similar solution with the same Resharper plugin and xml created using the resharper command line inspectcode executable and the resharper issues were succesfully added to sonarqube for the solution/project.

However, I noticed that the documentation for the C# 4.1 plugin said that usage of sonar-runner is now deprecated, and to use the MSBuildSonarQube Runner 1.0 to analyze C# projects, however, when I try to use the MSBuildSonarQube Runner, I get the skipping errors as stated above.

1
Are the results uploaded if your projects do not have "test" in the path? (see stackoverflow.com/questions/31722389/…)duncanp
This was the problem. Once I took "test" out of the path, the results were uploaded into the sonarqube database. Thanks for the link and your response.Chris West
please tag your question with sonarqube and msbuild or c# to make them easier to find.Dinesh Bolkensteyn

1 Answers

0
votes

This is caused by a bug in the test project detection mechanism present in the MSBuild SonarQube Runner version 1.0. It has been fixed in the newly release 1.0.1, see https://jira.sonarsource.com/browse/SONARMSBRU-121