Error: SonarQube analysis is only supported with MSBuild 14 or later

Hi!
Use docker-compose up this - https://github.com/SonarSource/docker-sonarqube/blob/master/recipes/docker-compose-postgres-example.yml
Create new project on localhost:9000
all is ok.
Create empty console application in VS2019 .Net 4.0 (try 4.0, 4.5, 4.7.2, 4.8) or .Net Core 2.2.
When in PowerShell in project folder execute MsBuild.exe /t:Rebuild - all is ok,
but after execution SonarScanner.MSBuild.exe begin /k:“testt” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“4bcd4a4b9cd0a385583b6c289ae791919653cf42”
have error : SonarQube analysis is only supported with MSBuild 14 or later

Help me pls!)

Hi,

MsBuild.exe /t:Rebuild should be executed after the SonarScanner.MSBuild.exe begin

Is that the case on your side ?

Thanks.

Mickaël

Yes.
Execute firstly:
SonarScanner.MSBuild.exe begin /k:“testt” /d:sonar.host.url=“http://localhost:9000” /d:sonar.login=“4bcd4a4b9cd0a385583b6c289ae791919653cf42”
Next:
MsBuild.exe /t:Rebuild
and have error: SonarQube analysis is only supported with MSBuild 14 or later

What is wrong?

Your MSBuildToolsVersion appears to be in version 4, which is far from version 14 and higher that we currently support.

Please check that the version of MSBuild.exe you are running fits this need (if it’s from your Path env variable, then check that it’s targeting the version you want)

On VS2019, it is located here : C:\Program Files (x86)\Microsoft Visual Studio\2019{edition}\MSBuild\Current\Bin

1 Like

Thx!
It help me.

A post was split to a new topic: C# code not being analyze in VSTS pipeline