Scan DotNet Core project with SonarQube TFS Extension


(Dave) #1


We want to use Sonarqube in TFS2017 to scan dotnet core project, but it fails with error:
[error]No analysable projects were found. SonarQube analysis will not be performed.

On Prepare Analysis step it uses SonarScanner for MSbuild 4.3.1:
SonarScanner for MSBuild 4.3.1
Using the .NET Framework version of the Scanner for MSBuild

Here we can download different version fo SonarScanner for specific dotnet version:
This might be a problem as it want to use “classic” version of SonarScanner?

Is there a way to specify with SonarScanner we want to use in Prepare Analysis Step?

SonarQube works for other non-dotnet core projects when we use “Integrate with MSBuild” option

(Duncan Pocklington) #2

Hi there,

Integrate with MSBuild is the option to choose whatever type of MSBuild project you are analyzing (the different downloads of the Scanner for MSBuild differ in the version of the framework that is required to run the scanner, rather than in the types of MSBuild project they can analyze. The VSTS extension picks the version of scanner to use based on the type of the build agent you are using, so if you were to build on a Linux agent you’d see from the log that it would use the NET Core version).

Are you building using a solution file, or are you building the individual *.csproj files directly?
If so, you’re probably hitting the issue described in this StackOverflow question.