SonarQube Scanner for MSBuild fails when being run as Visual Studio solution

250 views
Skip to first unread message

Christian Kössel

unread,
Apr 26, 2017, 8:49:46 AM4/26/17
to SonarQube
I'm trying to integrate the SonarQube Scanner for MSBuild (2.3) into the build configurations of our Visual Studio Solutions (VS 2015, C#).
Reason: Our CI server is TeamCity from JetBrains which builds Visual Studio Solutions by running msbuild on the solution file.

I have set up a little test project (just a hello world application) and added the begin step as pre-build event and the end step as post-build event.
The begin step runs fine, but the build step doesn't produce any output in .sonarqube and therefore the end step fails ("SonarQube was unable to collect the required information about your projects").

When I run the scanner and msbuild from the command line everything works, but exactly the same configuration fails, when being run inside Visual Studio and even from the command line with msbuild and the solution file.

To trace the issue down I compared the output of the two configurations line by line.
Both configurations run with MSBuild 14, all paths and variables and the complete build process are identical.

The only and crucial difference I could find is that msbuild runs the task CreateProjectSpecificDirs:
  "Creating directory "C:\NET\Test\TestApplication\.sonarqube\conf\TestApplication_8337"."
When running the solution this task is not executed, 

So the main questions are:
What is the difference concerning the scanner between running msbuild on project files and running msbuild on solution files?
How can I trigger creation of the project specific files for the Sonarqube scanner from a VS solution?



Amaury Leve

unread,
May 17, 2017, 12:46:56 PM5/17/17
to Christian Kössel, SonarQube
Hi Christian,

Can I ask why you are not using the plugin for Team City instead of some "hacks"?

Cheers,
Amaury

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/49a3a54d-119c-4201-8321-8c16e35bf785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 

Christian Kössel

unread,
May 18, 2017, 4:43:58 AM5/18/17
to SonarQube, christia...@barmer-gek.de
Hi Amaury,

thanks for the hint, the scanner works with the plugin!

Christian

Amaury Leve

unread,
May 18, 2017, 4:50:28 AM5/18/17
to Christian Kössel, SonarQube
Hi Christian!

Nice! If that's fine for you I am not going to spend time investigating this further.

Cheers,
Amaury


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages