SonarScanner for MSBuild, MSBuild 15

103 views
Skip to first unread message

daveno...@gmail.com

unread,
Jun 4, 2018, 3:58:24 PM6/4/18
to SonarQube
We have recently updated our continuous deployment environment (ThoughtWorks Go agents) to use MSBuild 15 (C# 7, etc.).

When we run SonarQube Scanner for MSBuild 2.2, the 'begin' stage appears to run fine.  Then we run MSBuild on the solution, run unit tests, code coverage, etc.
When SonarQubeScanner for MSBuild 2.2 'end' runs, we get the following error:

08:36:49.729      [exec] The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
08:36:49.729      [exec] Possible causes:
08:36:49.729      [exec]   1. The project has not been built - the project must be built in between the begin and end steps
08:36:49.729      [exec]   2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
08:36:49.729      [exec]   3. The begin, build or end steps have not all been launched from the same folder
08:36:49.729      [exec] 08:36:49.511  Post-processing failed. Exit code: 1

Our assumption is that we need to update our SonarQube Scanner for MSBuild.  If that's correct, what version should we update to? It's not clear to us looking online.

We did experiment a bit with newer versions - including 4.3 - but hit a wall becaus 4.2 throws a warning if the SonarScanner.MSBuild.exe process is run from a system

Why that requirement?

NAnt doesn't have an elegant way of exec'ing a process in a different account.

David

janos....@sonarsource.com

unread,
Jun 5, 2018, 4:17:27 AM6/5/18
to SonarQube
Hi,

This is the main documentation page of Scanner for MSBuild:

We recommend to use the latest versions of everything, but you must also consider the compatibility between scanner, msbuild and analyzers:

In recent versions of the scanner, analysis doesn't work when using a system account. The reason for this limitation has to do with the way we install and read targets.
Until then (and as the ticket says), the workaround is to use a non-system account.

From your context it seems that things were working for you with scanner 2.2 and an older msbuild and using system account. Unfortunately we don't know at which version it became impossible to use system account. So if using a non-system account is not an option for you, or waiting for the fix of #465, the only option left I see is to try some combination of older scanner and msbuild versions.

Janos
Reply all
Reply to author
Forward
0 new messages