No analysable project were found

No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.

2021-03-11T10:06:32.0532558Z ##[section]Starting: Run Code Analysis
2021-03-11T10:06:53.7354475Z ==============================================================================
2021-03-11T10:06:53.7355372Z Task : Run Code Analysis
2021-03-11T10:06:53.7355759Z Description : Run scanner and upload the results to the SonarQube server.
2021-03-11T10:06:53.7356130Z Version : 4.18.0
2021-03-11T10:06:53.7356333Z Author : sonarsource
2021-03-11T10:06:53.7356817Z Help : Version: 4.18.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

More Information
2021-03-11T10:06:53.7357373Z ==============================================================================
2021-03-11T10:06:55.1386481Z [command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.18.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe” end
2021-03-11T10:06:55.1387669Z SonarScanner for MSBuild 5.1
2021-03-11T10:06:55.1388780Z Using the .NET Framework version of the Scanner for MSBuild
2021-03-11T10:06:55.1772036Z Post-processing started.
2021-03-11T10:06:55.5939744Z 10:06:55.59 10:06:55.59 WARNING: The following projects do not have a valid ProjectGuid and were not built using a valid solution (.sln) thus will be skipped from analysis…
2021-03-11T10:06:55.5988026Z C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\13\s\StockManagement.csproj
2021-03-11T10:06:55.6366262Z ##[error]10:06:55.626 No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.
2021-03-11T10:06:55.6442060Z 10:06:55.626 No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.
2021-03-11T10:06:55.6765151Z 10:06:55.627 Generation of the sonar-properties file failed. Unable to complete the analysis.
2021-03-11T10:06:55.6836728Z ##[error]10:06:55.642 Post-processing failed. Exit code: 1
2021-03-11T10:06:55.6995227Z 10:06:55.642 Post-processing failed. Exit code: 1
2021-03-11T10:06:55.7043601Z ##[error]The process ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.18.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1
2021-03-11T10:06:55.7051795Z ##[section]Finishing: Run Code Analysis

Hi @vishnu_G. You’ll see I’ve split your post into a new thread. When you have a question, please start a new thread rather than adding to an existing thread.

A couple of questions:

  • which version of SonarQube are you using?
  • which version of MSBuild do you have installed on your build agent?

Also, please post the logs from the MSBuild step.

Hi Duncan,
Thanks for the headsup

I am using the
sonarqube version - sonarqube-8.6.1.40680
MSBUILD version - sonar-scanner - 4.4.0.2170

MSBuild Logs:
2021-03-11T14:56:32.6515859Z ##[section]Starting: Run Code Analysis
2021-03-11T14:56:53.4962841Z ==============================================================================
2021-03-11T14:56:53.4963209Z Task : Run Code Analysis
2021-03-11T14:56:53.4963517Z Description : Run scanner and upload the results to the SonarQube server.
2021-03-11T14:56:53.4963798Z Version : 4.18.0
2021-03-11T14:56:53.4963995Z Author : sonarsource
2021-03-11T14:56:53.4964536Z Help : Version: 4.18.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

More Information
2021-03-11T14:56:53.4965121Z ==============================================================================
2021-03-11T14:56:55.2859962Z [command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.18.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe” end
2021-03-11T14:56:55.2860865Z SonarScanner for MSBuild 5.1
2021-03-11T14:56:55.2861934Z Using the .NET Framework version of the Scanner for MSBuild
2021-03-11T14:56:55.2862451Z Post-processing started.
2021-03-11T14:56:55.2864805Z ##[error]14:56:54.496 The SonarScanner for 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 ste
    2021-03-11T14:56:55.2867216Z 14:56:54.496 The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
    2021-03-11T14:56:55.2867682Z Possible causes:
    2021-03-11T14:56:55.2869063Z ##[error]ps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects
    2021-03-11T14:56:55.2870063Z ps
    2021-03-11T14:56:55.2870476Z 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
    2021-03-11T14:56:55.2871002Z 3. The begin, build and end steps have not all been launched from the same folder
    2021-03-11T14:56:55.2871996Z ##[error]have a valid ProjectGuid and you have not used a solution (.sln)
    2021-03-11T14:56:55.2872916Z have a valid ProjectGuid and you have not used a solution (.sln)
    2021-03-11T14:56:55.2873385Z 14:56:54.497 Generation of the sonar-properties file failed. Unable to complete the analysis.
    2021-03-11T14:56:55.2874096Z ##[error]14:56:54.512 Post-processing failed. Exit code: 1
    2021-03-11T14:56:55.2874895Z 14:56:54.512 Post-processing failed. Exit code: 1
    2021-03-11T14:56:55.2876899Z ##[error]The process ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.18.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1
    2021-03-11T14:56:55.2881255Z ##[section]Finishing: Run Code Analysis.

@vishnu_G is this the same issue you’ve raised in this thread, or is it different issue?

The one which i shared with you is different one duncan,means different project solutions of dotnet but similar error when i run the Run code analysis task in the pipeline…

Ok. This thread looks to be a pretty clear duplicate of the “Case 2” in the other thread. Threads are much easier to deal with if they only deal with one issue. I suggest we deal with the Azure DevOps issue in this thread and use the other thread to focus on “Case 1”.

So: the logs you posted are for the “Run Code Analysis” step, not the MSBuild/VSBuild step.
Could you post those logs please? (I want to check the parameters that are being passed to the compiler).

Sure Duncan,

Please check the Build log as below:
2021-03-12T09:25:03.6267875Z ##[section]Starting: Build solution
2021-03-12T09:25:05.8075301Z ==============================================================================
2021-03-12T09:25:05.8075644Z Task : Visual Studio build
2021-03-12T09:25:05.8075917Z Description : Build with MSBuild and set the Visual Studio version property
2021-03-12T09:25:05.8076204Z Version : 1.183.0
2021-03-12T09:25:05.8076404Z Author : Microsoft Corporation
2021-03-12T09:25:05.8076724Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2021-03-12T09:25:05.8077180Z ==============================================================================
2021-03-12T09:25:09.1330708Z ##[command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\vswhere.exe” -version [16.0,17.0) -latest -format json
2021-03-12T09:25:09.8917352Z ##[command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\vswhere.exe” -version [16.0,17.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json
2021-03-12T09:25:10.0258585Z ##[command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\vswhere.exe” -version [15.0,16.0) -latest -format json
2021-03-12T09:25:10.6386275Z ##[command]“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe” “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj” /nologo /nr:false /dl:CentralLogger,“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll”;“RootDetailId=457b52c3-4853-46ba-a298-0875997a1195|SolutionDir=C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s”*ForwardingLogger,“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll” /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation=“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\a\WebApp.zip” /p:DeployIisAppPath=“Default Web Site” /p:platform=“any cpu” /p:configuration=“release” /p:VisualStudioVersion=“15.0” /p:_MSDeployUserAgent=“VSTS_ae9d253d-2f67-4f32-9967-30c71a6197c8_build_82_0”
2021-03-12T09:25:11.1863983Z Build started 3/12/2021 9:25:11 AM.
2021-03-12T09:25:11.6144190Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(781,5): Warning : The OutputPath property is not set for project ‘SocialGoal.Web.csproj’. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration=‘release’ Platform=‘any cpu’. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn’t exist for this project.
2021-03-12T09:25:11.6197584Z Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj” on node 1 (default targets).
2021-03-12T09:25:11.6282857Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(781,5): warning : The OutputPath property is not set for project ‘SocialGoal.Web.csproj’. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration=‘release’ Platform=‘any cpu’. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn’t exist for this project. [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj]
2021-03-12T09:25:11.6375314Z SonarQubeCategoriseProject:
2021-03-12T09:25:11.6379147Z Sonar: (SocialGoal.Web.csproj) Categorizing project as test or product code…
2021-03-12T09:25:11.7924524Z Sonar: (SocialGoal.Web.csproj) categorized as MAIN project (production code).
2021-03-12T09:25:11.8407171Z CreateProjectSpecificDirs:
2021-03-12T09:25:11.8993262Z Creating directory “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10.sonarqube\conf\0”.
2021-03-12T09:25:11.9004277Z SonarWriteFilesToAnalyze:
2021-03-12T09:25:12.0174390Z Sonar: (SocialGoal.Web.csproj) Number of files to analyse: 417. The list of files to be analyzed is in C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10.sonarqube\conf\0\FilesToAnalyze.txt.
2021-03-12T09:25:12.0546428Z ##[warning]C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10.sonarqube\bin\targets\SonarQube.Integration.targets(335,5): Warning : The project does not have a valid ProjectGuid. Analysis results for this project will not be uploaded. Project file: C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj
2021-03-12T09:25:12.0699851Z C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10.sonarqube\bin\targets\SonarQube.Integration.targets(335,5): warning : The project does not have a valid ProjectGuid. Analysis results for this project will not be uploaded. Project file: C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj]
2021-03-12T09:25:12.0716185Z Sonar: (SocialGoal.Web.csproj) Project processed successfully
2021-03-12T09:25:12.0745123Z Done Building Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj” (default targets).
2021-03-12T09:25:12.0757013Z
2021-03-12T09:25:12.0757678Z Build succeeded.
2021-03-12T09:25:12.0818113Z
2021-03-12T09:25:12.0819513Z “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj” (default target) (1) →
2021-03-12T09:25:12.0820395Z (_CheckForInvalidConfigurationAndPlatform target) →
2021-03-12T09:25:12.0822342Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(781,5): warning : The OutputPath property is not set for project ‘SocialGoal.Web.csproj’. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration=‘release’ Platform=‘any cpu’. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn’t exist for this project. [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj]
2021-03-12T09:25:12.0826556Z
2021-03-12T09:25:12.0826851Z
2021-03-12T09:25:12.0827389Z “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj” (default target) (1) →
2021-03-12T09:25:12.0827944Z (WriteSonarQubeProjectData target) →
2021-03-12T09:25:12.0829279Z C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10.sonarqube\bin\targets\SonarQube.Integration.targets(335,5): warning : The project does not have a valid ProjectGuid. Analysis results for this project will not be uploaded. Project file: C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\10\s\SocialGoal.Web.csproj]
2021-03-12T09:25:12.0832211Z
2021-03-12T09:25:12.0833937Z 2 Warning(s)
2021-03-12T09:25:12.0834330Z 0 Error(s)
2021-03-12T09:25:12.0849130Z
2021-03-12T09:25:12.0849729Z Time Elapsed 00:00:00.90
2021-03-12T09:25:12.3361132Z ##[section]Finishing: Build solution

Your build log contains the above warning, which is unrelated to the Sonar analysis. It doesn’t look there are any valid configurations that are being built.
Is your Azure Pipeline job actually generating the expected assembly files during the build?

Hi Duncan,

Please check the screenshot below

@vishnu_G that screen shot just shows the static configuration of the build pipeline i.e. that the pipeline will attempt to build that project.

What I’m interested in is what happens when the pipeline actually runs.

Which combinations of Configuration/Platform are you trying to build, and do any of them build successfully?

@duncanp ,Is this something like this you are expecting!

@vishnu_G no, not exactly. However, let’s come back to that later if necessary. There’s another warning in the log that’s relevant:

There used to be a limitation in the scanner which meant that either you had to build an .sln, or you had to make sure there was a ProjectGuid in each project you wanted to analyse.

However, that limitation was removed in v5 of the SonarScanner for MSBuild, and it looks from the logs that your are running SonarScanner for MSBuild 5.1, so I wouldn’t expect to see that warning message.

Does your project file contain a ProjectGuid setting like the following, and if so what is it?

<PropertyGroup>
...
    <ProjectGuid>{7e3adcd6-01d7-44e2-b12f-c485c35c8a9c}</ProjectGuid>
...
</PropertyGroup>

Hi Duncan,

I am using the sonar scanner version - sonar-scanner-4.6.0.2311-windows
Please check the csproj solution file in xml format.

Due to limitation of letters here in posting for the Sonar_Issue.txt (39.9 KB) csproj file i am attaching it here please verify once.

Hhmm, that project file looks ok, so I’m not sure why the logs you posted are saying the scanner could not find a valid project guid.

According to the logs you posted above you are using v4.18.0 of the SonarQube Azure DevOps extension, which has SonarScanner for MSBuild 5.1 embedded inside it.

Is that not the case? Are you also trying to analyse the project outside of your Azure pipeline?

Hi Duncan,

I have tried another approach which gives the code analysis in the sonarqube dashboard by running the below commands in the command prompt.
without any issues i can get the analysis report.

SonarScanner.MSBuild.exe begin /k:"****************" /d:sonar.host.url=“http://localhost:8000” /d:sonar.login=""
MsBuild.exe /t:Rebuild
SonarScanner.MSBuild.exe end /d:sonar.login="
"

But this is manual process,my requirement and priority is to achieve through the azure pipeline.
Need your inputs how to proceed furthur

So running the analysis from the command line works and uploads the results as expected, but running inside the build pipeline does not?

That suggests there is a configuration problem with your build pipeline.
According to the screen shot above, you have /p:SkipInvalidConfigurations=true set in the MSBuild arguments. What happens if you remove this setting (or change it to false)?

Yes Duncan, exactly when i try to build from azure pipeline i am facing this issues,

I have tried changing the setting /p:SkipInvalidConfigurations=‘false’ but not much change in the result.
I have tried with new solution and new pipeline same issue.

2021-03-18T10:20:43.7569016Z ##[section]Starting: Run Code Analysis
2021-03-18T10:21:04.5602011Z ==============================================================================
2021-03-18T10:21:04.5602522Z Task : Run Code Analysis
2021-03-18T10:21:04.5602806Z Description : Run scanner and upload the results to the SonarQube server.
2021-03-18T10:21:04.5603148Z Version : 4.18.0
2021-03-18T10:21:04.5603376Z Author : sonarsource
2021-03-18T10:21:04.5604374Z Help : Version: 4.18.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

More Information
2021-03-18T10:21:04.5605109Z ==============================================================================
2021-03-18T10:21:05.5359532Z [command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.18.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe” end
2021-03-18T10:21:05.5360501Z SonarScanner for MSBuild 5.1
2021-03-18T10:21:05.5361028Z Using the .NET Framework version of the Scanner for MSBuild
2021-03-18T10:21:05.5361445Z Post-processing started.
2021-03-18T10:21:05.5363094Z ##[error]10:21:05.442 The SonarScanner for 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 ste
    2021-03-18T10:21:05.5366357Z 10:21:05.442 The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
    2021-03-18T10:21:05.5366957Z Possible causes:
    2021-03-18T10:21:05.5368440Z ##[error]ps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects
    2021-03-18T10:21:05.5370494Z ps
    2021-03-18T10:21:05.5371599Z 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
    2021-03-18T10:21:05.5372482Z 3. The begin, build and end steps have not all been launched from the same folder
    2021-03-18T10:21:05.5373931Z ##[error]have a valid ProjectGuid and you have not used a solution (.sln)
    2021-03-18T10:21:05.5375546Z have a valid ProjectGuid and you have not used a solution (.sln)
    2021-03-18T10:21:05.5376155Z 10:21:05.443 Generation of the sonar-properties file failed. Unable to complete the analysis.
    2021-03-18T10:21:05.5377650Z ##[error]10:21:05.464 Post-processing failed. Exit code: 1
    2021-03-18T10:21:05.5383277Z 10:21:05.464 Post-processing failed. Exit code: 1
    2021-03-18T10:21:05.5386139Z ##[error]The process ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.18.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1
    2021-03-18T10:21:05.5493961Z ##[section]Finishing: Run Code Analysis

Hi @vishnu_G. Could you share the detailed logs for the MSBuild step with “/p:SkipInvalidConfigurations=false” please?

To turn on detailed MSBuild logging, you’ll need to add /v:diag to the MSBuild arguments.

Sure Duncan,
I have a given try by changing the setting of the /p:SkipInvalidConfigurations=false
please check the below details for the MSBuild Log :slight_smile:

2021-03-18T10:46:16.9625474Z ##[section]Starting: Build solution
2021-03-18T10:46:21.2181985Z ==============================================================================
2021-03-18T10:46:21.2182356Z Task : Visual Studio build
2021-03-18T10:46:21.2182626Z Description : Build with MSBuild and set the Visual Studio version property
2021-03-18T10:46:21.2182891Z Version : 1.183.0
2021-03-18T10:46:21.2183100Z Author : Microsoft Corporation
2021-03-18T10:46:21.2183398Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2021-03-18T10:46:21.2183760Z ==============================================================================
2021-03-18T10:46:30.3669311Z ##[command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\vswhere.exe” -version [16.0,17.0) -latest -format json
2021-03-18T10:46:30.3670104Z ##[command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\vswhere.exe” -version [16.0,17.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json
2021-03-18T10:46:30.3670923Z ##[command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\vswhere.exe” -version [15.0,16.0) -latest -format json
2021-03-18T10:46:30.3825264Z ##[command]“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe” “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\s\SocialGoal.Web.csproj” /nologo /nr:false /dl:CentralLogger,“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll”;“RootDetailId=3ab26359-b266-4681-9784-25263565cfc1|SolutionDir=C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\s”*ForwardingLogger,“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.183.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll” /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=false/p:DesktopBuildPackageLocation=“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\a\WebApp.zip” /p:DeployIisAppPath=“Default Web Site” /p:platform=“any cpu” /p:configuration=“release” /p:VisualStudioVersion=“15.0” /p:_MSDeployUserAgent=“VSTS_ae9d253d-2f67-4f32-9967-30c71a6197c8_build_96_0”
2021-03-18T10:46:30.3828784Z Build started 3/18/2021 10:46:30 AM.
2021-03-18T10:46:31.6977406Z ##[error]C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(780,5): Error : The OutputPath property is not set for project ‘SocialGoal.Web.csproj’. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration=‘release’ Platform=‘any cpu’. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn’t exist for this project.
2021-03-18T10:46:31.7023610Z Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\s\SocialGoal.Web.csproj” on node 1 (default targets).
2021-03-18T10:46:31.7026704Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(780,5): error : The OutputPath property is not set for project ‘SocialGoal.Web.csproj’. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration=‘release’ Platform=‘any cpu’. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn’t exist for this project. [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\s\SocialGoal.Web.csproj]
2021-03-18T10:46:31.7353207Z Done Building Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\s\SocialGoal.Web.csproj” (default targets) – FAILED.
2021-03-18T10:46:31.7711801Z
2021-03-18T10:46:31.7786964Z Build FAILED.
2021-03-18T10:46:31.7953442Z
2021-03-18T10:46:31.8059154Z “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\s\SocialGoal.Web.csproj” (default target) (1) →
2021-03-18T10:46:31.8389710Z (_CheckForInvalidConfigurationAndPlatform target) →
2021-03-18T10:46:31.8410191Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(780,5): error : The OutputPath property is not set for project ‘SocialGoal.Web.csproj’. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration=‘release’ Platform=‘any cpu’. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn’t exist for this project. [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\18\s\SocialGoal.Web.csproj]
2021-03-18T10:46:31.8417781Z
2021-03-18T10:46:31.8540360Z 0 Warning(s)
2021-03-18T10:46:31.8842437Z 1 Error(s)
2021-03-18T10:46:31.8992463Z
2021-03-18T10:46:31.9060489Z Time Elapsed 00:00:01.48
2021-03-18T10:46:32.7073738Z ##[error]Process ‘msbuild.exe’ exited with code ‘1’.
2021-03-18T10:46:33.0019769Z ##[section]Finishing: Build solution

So, your build is now failing because you aren’t specifying a valid Configuration and Platform in the pipeline.

This isn’t related the Sonar analysis, although I suspect it might be why no analysis results are being uploaded. My guess is that your pipeline does not specify any valid Configuration/Platform combinations, so the project is not being built, which in turn means it is not being analysed → there are no analysis results to upload.

This takes us back to the question I asked earlier in the thread: which Configuration/Platform combinations is your pipeline building? For non-yaml Azure pipelines, this will normally be specified in Variables tab:

You will need to configure your pipeline so that the project is built successfully for at least one Configuration/Platform combination.