The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
I have setup sonarqube, I have created a .bat file to execute. The SonarQube.MSBuild scanner runs. The MS Build succeeds
* BAT FILE IN PROJECT ROOT *
cd c:\tutorials\udemy\sonarqubeweb SonarScanner.MSBuild.exe begin /k:"CSharpTest" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="7e14e692c985484a9453aca9fb79920bc83214c7"
cd C:\Program Files (x86)\MSBuild\14.0\Bin MSBuild.exe C:\Tutorials\Udemy\SonarqubeWeb\SonarqubeWeb.sln /t:Rebuild
cd c:\tutorials\udemy\sonarqubeweb SonarScanner.MSBuild.exe end /d:sonar.login="7e14e692c985484a9453aca9fb79920bc83214c7"
OUTPUT
C:\Tutorials\Udemy\SonarqubeWeb>SonarQubeWeb.bat
C:\Tutorials\Udemy\SonarqubeWeb>cd c:\tutorials\udemy\sonarqubeweb
C:\Tutorials\Udemy\SonarqubeWeb>SonarScanner.MSBuild.exe begin /k:"CSharpTest" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="7e14e692c985484a9453aca9fb79920bc83214c7" SonarScanner for MSBuild 4.6.2 Using the .NET Framework version of the Scanner for MSBuild Pre-processing started. Preparing working directories... 03:48:16.862 Updating build integration targets... 03:48:16.942 Fetching analysis configuration settings... 03:48:17.463 Provisioning analyzer assemblies for cs... 03:48:17.464 Installing required Roslyn analyzers... 03:48:17.771 Provisioning analyzer assemblies for vbnet... 03:48:17.772 Installing required Roslyn analyzers... 03:48:17.811 Pre-processing succeeded.
C:\Tutorials\Udemy\SonarqubeWeb>cd C:\Program Files (x86)\MSBuild\14.0\Bin
C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild.exe C:\Tutorials\Udemy\SonarqubeWeb\SonarqubeWeb.sln /t:Rebuild Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Build started 6/9/2019 3:48:17 AM. Project "C:\Tutorials\Udemy\SonarqubeWeb\SonarqubeWeb.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Debug|Any CPU". The target "MvcBuildViews" listed in a BeforeTargets attribute at "C:\Tutorials\Udemy\SonarqubeWeb\packages\MSBuild.Mic rosoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath\Web\Microsoft.Web.Publishing.targets (843,131)" does not exi st in the project, and will be ignored. Project "C:\Tutorials\Udemy\SonarqubeWeb\SonarqubeWeb.sln" (1) is building "C:\Tutorials\Udemy\SonarqubeWeb\SonarqubeWe b\SonarqubeWeb.csproj" (2) on node 1 (Rebuild target(s)).
Done Building Project "C:\Tutorials\Udemy\SonarqubeWeb\SonarqubeWeb\SonarqubeWeb.csproj" (Rebuild target(s)).
Done Building Project "C:\Tutorials\Udemy\SonarqubeWeb\SonarqubeWeb.sln" (Rebuild target(s)).
Build succeeded. 0 Warning(s) 0 Error(s)
Time Elapsed 00:00:04.85
cd c:\tutorials\udemy\sonarqubeweb
SonarScanner.MSBuild.exe end /d:sonar.login="7e14e692c985484a9453aca9fb79920bc83214c7" SonarScanner for MSBuild 4.6.2 Using the .NET Framework version of the Scanner for MSBuild Post-processing started. 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 14.0 and 15.0 are supported 3. The begin, build and end steps have not all been launched from the same folder 4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln) Generation of the sonar-properties file failed. Unable to complete SonarQube analysis. 03:48:23.091 Post-processing failed. Exit code: 1