Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why SonarQube Scanner for MSBuild does not work with MSBuild 15.0?

Tags:

I rencently upgraded my Visual Studio from 2015 to 2017. The build process now uses MSBuild 15.0 so I can use C#7.

I installed a SonarQube server from the latest version 6.3 and I use the latest version of the C# scanner 2.2.0.24.

I'm trying to make an analysis of my code, from the folder where my solution is:

  1. Run SonarQube.Scanner.MSBuild.exe begin /key:"myproject".

    SonarQube Scanner for MSBuild 2.2
    Default properties file was found at C:\myfolder\SonarQube.Analysis.xml
    Loading analysis properties from C:\myfolder\SonarQube.Analysis.xml
    Pre-processing started.
    Preparing working directories...
    SonarQube Scanner for MSBuild 2.2
    11:21:18.714  Updating build integration targets...
    11:21:18.735  Fetching analysis configuration settings...
    11:21:19.341  Generating rulesets...
    11:21:19.39  Provisioning analyzer assemblies for cs...
    11:21:19.392  Installing required Roslyn analyzers...
    11:21:19.435  Pre-processing succeeded.
    
  2. Run MSBuild version 15.1.548.43366.

    ...
    
    Build succeeded.
        0 Warning(s)
        0 Error(s)
    
  3. Run SonarQube.Scanner.MSBuild.exe end.

    SonarQube Scanner for MSBuild 2.2
    Default properties file was found at C:\myfolder\SonarQube.Analysis.xml
    Loading analysis properties from C:\myfolder\SonarQube.Analysis.xml
    Post-processing started.
    SonarQube Scanner for MSBuild 2.2
    The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
    Possible causes:
    1. The project has not been built - the project must be built in between the begin and end steps
    2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
    3. The begin, build or end steps have not all been launched from the same folder
    Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
    11:22:06.162  Creating a summary markdown file...
    11:22:06.167  Post-processing failed. Exit code: 1
    

I can't figure out why it is failing.

Does the c# sonarqube scanner 2.2 support MSBuild 15.0?

like image 246
Hemel Avatar asked Apr 03 '17 09:04

Hemel


People also ask

Does SonarQube support .NET 6?

If you are using the . NET Framework version of the scanner you will need . NET Framework v4. 6 or above.

How do I know what version of MSBuild I have?

There is no way to determine which version of MSBuild was used. There is no days in the executable that says which version was used and nothing in them specific to MSBuild to use as a trail of breadcrumbs to determine it either. You dont even need MSBuild to build an executable.

Does SonarQube support .NET core?

It is the result of a collaboration between SonarSource and Microsoft . SonarScanner for . NET is distributed as a standalone command line executable, as an extension for Azure DevOps Server, and as a plugin for Jenkins. It supports .


1 Answers

MSBuild 15 is not supported by the SonarQube Scanner for MSBuild 2.2.

The good news is that we are about to release version 2.3 of the Scanner for MSBuild that fixes this bug. You can read more on the bug ticket SONARMSBRU-288.

The release will happen within the first half of April 2017.

like image 76
Fabrice - SonarSource Team Avatar answered Sep 25 '22 12:09

Fabrice - SonarSource Team