No analysable project were found

Yes Duncan,

Please check the below settings for my pipeline.

Hi @vishnu_G,

Ok: that takes us back to an earlier post:

There is a problem with the configuration of your pipeline that means your project is not being built correctly. This is purely an MSBuild issue, nothing to do with the Sonar analysis. So the first thing you need to do is fix your pipeline so it builds correctly.

The warning quoted above goes on to give some suggestions about what the problem might be:

You might want to try running some builds locally from the command line to help you decide how to configure your pipeline. From a quick test I did with an old-style ASP.NET project, I got the following:

// sln + "any cpu" -> succeeds
msbuild MyApp.sln /p:platform="any cpu"

// sln + "anycpu" -> fails
msbuild MyApp.sln /p:platform="anycpu"

// csproj + "any cpu" -> fails
msbuild MyApp.csproj /p:platform="any cpu"

// csproj + "anycpu" -> succeeds
msbuild MyApp.csproj /p:platform="anycpu"

Hi Duncan,

I have tried with the settings by making changes in the variable section in the pipeline before build for the .csproj and anycpu.please refer the screenshot below.

After the build task this is the error log it is showing

2021-03-22T05:55:04.8859893Z ##[section]Starting: Build
2021-03-22T05:55:06.9671331Z ==============================================================================
2021-03-22T05:55:06.9671758Z Task : Visual Studio build
2021-03-22T05:55:06.9672169Z Description : Build with MSBuild and set the Visual Studio version property
2021-03-22T05:55:06.9672701Z Version : 1.183.0
2021-03-22T05:55:06.9672893Z Author : Microsoft Corporation
2021-03-22T05:55:06.9673177Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2021-03-22T05:55:06.9673509Z ==============================================================================
2021-03-22T05:55:09.6075946Z ##[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-22T05:55:10.5141724Z ##[command]“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe” “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\WelcomeSonar.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=6a17f52c-f23e-4e3c-a2f5-331bf192f749|SolutionDir=C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\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:platform=“anycpu” /p:configuration=“release” /p:VisualStudioVersion=“16.0” /p:_MSDeployUserAgent=“VSTS_ae9d253d-2f67-4f32-9967-30c71a6197c8_build_107_0”
2021-03-22T05:55:11.2914165Z Build started 3/22/2021 5:55:11 AM.
2021-03-22T05:55:11.8946772Z Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\WelcomeSonar.csproj” on node 1 (default targets).
2021-03-22T05:55:11.9058473Z GenerateBindingRedirects:
2021-03-22T05:55:11.9208120Z No suggested binding redirects from ResolveAssemblyReferences.
2021-03-22T05:55:11.9208869Z GenerateTargetFrameworkMonikerAttribute:
2021-03-22T05:55:11.9209500Z Skipping target “GenerateTargetFrameworkMonikerAttribute” because all output files are up-to-date with respect to the input files.
2021-03-22T05:55:11.9631561Z CoreCompile:
2021-03-22T05:55:11.9636802Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /fullpaths /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\Microsoft.CSharp.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\mscorlib.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\System.Core.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\System.Data.DataSetExtensions.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\System.Data.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\System.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\System.Net.Http.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\System.Xml.dll” /reference:“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\System.Xml.Linq.dll” /debug:pdbonly /filealign:512 /optimize+ /out:obj\release\WelcomeSonar.exe /subsystemversion:6.00 /target:exe /utf8output /deterministic+ /langversion:7.3 Program.cs Properties\AssemblyInfo.cs “obj\release.NETFramework,Version=v4.6.1.AssemblyAttributes.cs”
2021-03-22T05:55:11.9719472Z Using shared compilation with compiler from directory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn
2021-03-22T05:55:13.0425400Z ##[error]CSC(0,0): Error CS2001: Source file ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\Properties\AssemblyInfo.cs’ could not be found.
2021-03-22T05:55:13.0443101Z CSC : error CS2001: Source file ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\Properties\AssemblyInfo.cs’ could not be found. [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\WelcomeSonar.csproj]
2021-03-22T05:55:13.0467888Z Done Building Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\WelcomeSonar.csproj” (default targets) – FAILED.
2021-03-22T05:55:13.0491717Z
2021-03-22T05:55:13.0502296Z Build FAILED.
2021-03-22T05:55:13.0545226Z
2021-03-22T05:55:13.0549165Z “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\WelcomeSonar.csproj” (default target) (1) →
2021-03-22T05:55:13.0550482Z (CoreCompile target) →
2021-03-22T05:55:13.0551892Z CSC : error CS2001: Source file ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\Properties\AssemblyInfo.cs’ could not be found. [C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\29\s\WelcomeSonar.csproj]
2021-03-22T05:55:13.0572449Z
2021-03-22T05:55:13.0573312Z 0 Warning(s)
2021-03-22T05:55:13.0574059Z 1 Error(s)
2021-03-22T05:55:13.0579140Z
2021-03-22T05:55:13.0579821Z Time Elapsed 00:00:01.76
2021-03-22T05:55:13.3435244Z ##[error]Process ‘msbuild.exe’ exited with code ‘1’.
2021-03-22T05:55:13.4291306Z ##[section]Finishing: Build


I just tried with sonarcloud extension in the azure devops.please verify the logs and screeshots below:

Pipeline settings:


Please check the log:

2021-03-22T08:39:55.7656125Z ##[section]Starting: Run Code Analysis
2021-03-22T08:40:20.5557367Z ==============================================================================
2021-03-22T08:40:20.5557758Z Task : Run Code Analysis
2021-03-22T08:40:20.5558208Z Description : Run scanner and upload the results to the SonarCloud server.
2021-03-22T08:40:20.5558504Z Version : 1.20.0
2021-03-22T08:40:20.5558704Z Author : sonarsource
2021-03-22T08:40:20.5559483Z Help : Version: 1.20.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-22T08:40:20.5560367Z ==============================================================================
2021-03-22T08:40:21.5975607Z [command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.17.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe” end
2021-03-22T08:40:21.5976738Z SonarScanner for MSBuild 5.1
2021-03-22T08:40:21.5978008Z Using the .NET Framework version of the Scanner for MSBuild
2021-03-22T08:40:21.5979182Z Post-processing started.
2021-03-22T08:40:21.5980949Z ##[error]08:40:21.541 The SonarScanner for MSBuild integration failed: SonarCloud 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 st
    2021-03-22T08:40:21.5985186Z 08:40:21.541 The SonarScanner for MSBuild integration failed: SonarCloud was unable to collect the required information about your projects.
    2021-03-22T08:40:21.5986015Z Possible causes:
    2021-03-22T08:40:21.5988987Z ##[error]eps
  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 project
    2021-03-22T08:40:21.5991805Z eps
    2021-03-22T08:40:21.5992496Z 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-22T08:40:21.5993834Z 3. The begin, build and end steps have not all been launched from the same folder
    2021-03-22T08:40:21.5995010Z ##[error]s have a valid ProjectGuid and you have not used a solution (.sln)
    2021-03-22T08:40:21.5998658Z s have a valid ProjectGuid and you have not used a solution (.sln)
    2021-03-22T08:40:21.5999271Z 08:40:21.543 Generation of the sonar-properties file failed. Unable to complete the analysis.
    2021-03-22T08:40:21.6001126Z ##[error]08:40:21.562 Post-processing failed. Exit code: 1
    2021-03-22T08:40:21.6012073Z 08:40:21.562 Post-processing failed. Exit code: 1
    2021-03-22T08:40:21.6015894Z ##[error]The process ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.17.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1
    2021-03-22T08:40:21.6031952Z ##[section]Finishing: Run Code Analysis

I wouldn’t worry about the Sonar steps until you have a build that works. In fact, it would be worth temporarily disabling the Sonar “prepare” and “run code analysis” steps.

Is that file supposed to be generated during the build, or has it accidentally be omitted from source control?

Hi Duncan,

Assemblyinfo.cs is the file belongs to c# source code which i am working with for this pipeline.
Anyhow
I took new pipeline with same source code,where i ran till build step without adding any of the sonar tasks.

2021-03-22T16:02:10.2879578Z ##[section]Starting: Agent job 1
2021-03-22T16:02:10.5592076Z ##[section]Starting: Initialize job
2021-03-22T16:02:10.5593642Z Agent name: ‘Agent003’
2021-03-22T16:02:10.5593987Z Agent machine name: ‘DOPSSONARQUBE01’
2021-03-22T16:02:10.5594214Z Current agent version: ‘2.181.2’
2021-03-22T16:02:10.5627787Z Agent running as: ‘DOPSSONARQUBE01$’
2021-03-22T16:02:10.5676242Z Prepare build directory.
2021-03-22T16:02:10.6573340Z Set build variables.
2021-03-22T16:02:10.6621193Z Download all required tasks.
2021-03-22T16:04:07.0725868Z Checking job knob settings.
2021-03-22T16:04:07.0735521Z Finished checking job knob settings.
2021-03-22T16:04:07.1211552Z Start tracking orphan processes.
2021-03-22T16:04:07.1362324Z ##[section]Finishing: Initialize job
2021-03-22T16:04:07.2165649Z ##[section]Starting: Checkout SampleRepo@main to s
2021-03-22T16:04:07.3141608Z ==============================================================================
2021-03-22T16:04:07.3142382Z Task : Get sources
2021-03-22T16:04:07.3142935Z Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2021-03-22T16:04:07.3143194Z Version : 1.0.0
2021-03-22T16:04:07.3143573Z Author : Microsoft
2021-03-22T16:04:07.3144210Z Help : More Information
2021-03-22T16:04:07.3144540Z ==============================================================================
2021-03-22T16:04:08.4602222Z Syncing repository: SampleRepo (Git)
2021-03-22T16:04:08.6213372Z Prepending Path environment variable with directory containing ‘git.exe’.
2021-03-22T16:04:08.8137811Z ##[command]git version
2021-03-22T16:04:08.9973475Z git version 2.28.0.windows.1
2021-03-22T16:04:09.1962168Z ##[command]git init “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\s”
2021-03-22T16:04:09.5560682Z Initialized empty Git repository in C:/SonarAgent/vsts-agent-win-x64-2.181.2 (1)/_work/32/s/.git/
2021-03-22T16:04:09.5843777Z ##[command]git remote add origin https://NTTDATA-DTA-ORG@dev.azure.com/NTTDATA-DTA-ORG/Azure%20DevOps%20Demo/_git/SampleRepo
2021-03-22T16:04:09.8044075Z ##[command]git config gc.auto 0
2021-03-22T16:04:11.9588300Z ##[command]git config --get-all http.https://NTTDATA-DTA-ORG@dev.azure.com/NTTDATA-DTA-ORG/Azure%20DevOps%20Demo/_git/SampleRepo.extraheader
2021-03-22T16:04:11.9593638Z ##[command]git config --get-all http.proxy
2021-03-22T16:04:11.9597837Z ##[command]git config http.version HTTP/1.1
2021-03-22T16:04:11.9605425Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer " fetch --force --tags --prune --progress --no-recurse-submodules origin
2021-03-22T16:04:13.5358098Z remote: Azure Repos
2021-03-22T16:04:13.5361913Z remote:
2021-03-22T16:04:13.5380252Z remote: Found 19 objects to send. (59 ms)
2021-03-22T16:04:13.5697219Z From https://dev.azure.com/NTTDATA-DTA-ORG/Azure%20DevOps%20Demo/_git/SampleRepo
2021-03-22T16:04:13.5734931Z * [new branch] main → origin/main
2021-03-22T16:04:13.7159233Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer " fetch --force --tags --prune --progress --no-recurse-submodules origin +44d84685c346021910357a9316c3d63c4a1b676c:refs/remotes/origin/44d84685c346021910357a9316c3d63c4a1b676c
2021-03-22T16:04:14.8265385Z From https://dev.azure.com/NTTDATA-DTA-ORG/Azure%20DevOps%20Demo/_git/SampleRepo
2021-03-22T16:04:14.8275156Z * [new ref] 44d84685c346021910357a9316c3d63c4a1b676c → origin/44d84685c346021910357a9316c3d63c4a1b676c
2021-03-22T16:04:15.0493268Z ##[command]git checkout --progress --force 44d84685c346021910357a9316c3d63c4a1b676c
2021-03-22T16:04:16.4678716Z Note: switching to ‘44d84685c346021910357a9316c3d63c4a1b676c’.
2021-03-22T16:04:16.4681360Z
2021-03-22T16:04:16.4682465Z You are in ‘detached HEAD’ state. You can look around, make experimental
2021-03-22T16:04:16.4683599Z changes and commit them, and you can discard any commits you make in this
2021-03-22T16:04:16.4684475Z state without impacting any branches by switching back to a branch.
2021-03-22T16:04:16.4686628Z
2021-03-22T16:04:16.4687616Z If you want to create a new branch to retain commits you create, you may
2021-03-22T16:04:16.4688567Z do so (now or later) by using -c with the switch command. Example:
2021-03-22T16:04:16.4690410Z
2021-03-22T16:04:16.4691289Z git switch -c
2021-03-22T16:04:16.4691897Z
2021-03-22T16:04:16.4692678Z Or undo this operation with:
2021-03-22T16:04:16.4693232Z
2021-03-22T16:04:16.4693877Z git switch -
2021-03-22T16:04:16.4694389Z
2021-03-22T16:04:16.4695112Z Turn off this advice by setting config variable advice.detachedHead to false
2021-03-22T16:04:16.4695727Z
2021-03-22T16:04:16.4781886Z HEAD is now at 44d8468 Added 10 files to /
2021-03-22T16:04:16.5043529Z ##[section]Finishing: Checkout SampleRepo@main to s
2021-03-22T16:04:16.5254210Z ##[section]Starting: Use NuGet 4.4.1
2021-03-22T16:04:42.0805618Z ==============================================================================
2021-03-22T16:04:42.0806286Z Task : NuGet tool installer
2021-03-22T16:04:42.0807455Z Description : Acquires a specific version of NuGet from the internet or the tools cache and adds it to the PATH. Use this task to change the version of NuGet used in the NuGet tasks.
2021-03-22T16:04:42.0808072Z Version : 0.179.1
2021-03-22T16:04:42.0808395Z Author : Microsoft Corporation
2021-03-22T16:04:42.0809036Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/prev-versions/nuget-installer-0
2021-03-22T16:04:42.0809469Z ==============================================================================
2021-03-22T16:04:43.9224938Z Found tool in cache: NuGet 4.4.1 x64
2021-03-22T16:04:43.9228317Z Resolved from tool cache: 4.4.1
2021-03-22T16:04:43.9228723Z Using version: 4.4.1
2021-03-22T16:04:43.9230776Z Found tool in cache: NuGet 4.4.1 x64
2021-03-22T16:04:43.9231741Z Using tool path: C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tool\NuGet\4.4.1\x64
2021-03-22T16:04:43.9232806Z Prepending PATH environment variable with directory: C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tool\NuGet\4.4.1\x64
2021-03-22T16:04:43.9649984Z ##[section]Finishing: Use NuGet 4.4.1
2021-03-22T16:04:43.9811984Z ##[section]Starting: NuGet restore
2021-03-22T16:05:25.2441317Z ==============================================================================
2021-03-22T16:05:25.2441800Z Task : NuGet
2021-03-22T16:05:25.2442368Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Azure Artifacts and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
2021-03-22T16:05:25.2442962Z Version : 2.179.0
2021-03-22T16:05:25.2443640Z Author : Microsoft Corporation
2021-03-22T16:05:25.2444034Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/nuget
2021-03-22T16:05:25.2444409Z ==============================================================================
2021-03-22T16:05:26.8176335Z SYSTEMVSSCONNECTION exists true
2021-03-22T16:05:26.8959740Z SYSTEMVSSCONNECTION exists true
2021-03-22T16:05:27.3051688Z [command]C:\windows\system32\chcp.com 65001
2021-03-22T16:05:27.3632758Z Active code page: 65001
2021-03-22T16:05:29.0647215Z Detected NuGet version 4.4.1.4656 / 4.4.1
2021-03-22T16:05:29.0820715Z SYSTEMVSSCONNECTION exists true
2021-03-22T16:05:29.0858450Z [command]“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work_tool\NuGet\4.4.1\x64\nuget.exe” sources Add -NonInteractive -Name NuGetOrg -Source https://api.nuget.org/v3/index.json -ConfigFile “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\Nuget\tempNuGet_3175.config”
2021-03-22T16:05:29.9161687Z Package Source with Name: NuGetOrg added successfully.
2021-03-22T16:05:29.9624005Z ##[section]Finishing: NuGet restore
2021-03-22T16:05:29.9769625Z ##[section]Starting: Build solution
2021-03-22T16:05:32.6986098Z ==============================================================================
2021-03-22T16:05:32.6987060Z Task : Visual Studio build
2021-03-22T16:05:32.6987348Z Description : Build with MSBuild and set the Visual Studio version property
2021-03-22T16:05:32.6987628Z Version : 1.183.0
2021-03-22T16:05:32.6987855Z Author : Microsoft Corporation
2021-03-22T16:05:32.6988169Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
2021-03-22T16:05:32.6988522Z ==============================================================================
2021-03-22T16:05:35.2530029Z ##[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-22T16:05:35.9363001Z ##[command]“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe” “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\s\WelcomeSonar.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=498fbef2-2734-43ae-b7d4-543456c7bcf3|SolutionDir=C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\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:PackageLocation=“C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\a\” /p:platform=“any cpu” /p:configuration=“release” /p:VisualStudioVersion=“16.0” /p:_MSDeployUserAgent=“VSTS_ae9d253d-2f67-4f32-9967-30c71a6197c8_build_113_0”
2021-03-22T16:05:36.3886270Z Build started 3/22/2021 4:05:36 PM.
2021-03-22T16:05:36.7539481Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(817,5): Warning : The BaseOutputPath/OutputPath property is not set for project ‘WelcomeSonar.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-22T16:05:36.7557500Z Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\s\WelcomeSonar.csproj” on node 1 (default targets).
2021-03-22T16:05:36.7565334Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(817,5): warning : The BaseOutputPath/OutputPath property is not set for project ‘WelcomeSonar.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\32\s\WelcomeSonar.csproj]
2021-03-22T16:05:36.7588539Z Done Building Project “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\s\WelcomeSonar.csproj” (default targets).
2021-03-22T16:05:36.7782451Z
2021-03-22T16:05:36.7796302Z Build succeeded.
2021-03-22T16:05:36.7867223Z
2021-03-22T16:05:36.7872140Z “C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\s\WelcomeSonar.csproj” (default target) (1) →
2021-03-22T16:05:36.7874807Z (_CheckForInvalidConfigurationAndPlatform target) →
2021-03-22T16:05:36.8391009Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(817,5): warning : The BaseOutputPath/OutputPath property is not set for project ‘WelcomeSonar.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\32\s\WelcomeSonar.csproj]
2021-03-22T16:05:36.8411567Z
2021-03-22T16:05:36.8441532Z 1 Warning(s)
2021-03-22T16:05:36.8460534Z 0 Error(s)
2021-03-22T16:05:36.8465296Z
2021-03-22T16:05:36.8561002Z Time Elapsed 00:00:00.38
2021-03-22T16:05:36.8996689Z ##[section]Finishing: Build solution
2021-03-22T16:05:36.9138411Z ##[section]Starting: Test Assemblies
2021-03-22T16:06:10.2504163Z ==============================================================================
2021-03-22T16:06:10.2504588Z Task : Visual Studio Test
2021-03-22T16:06:10.2505446Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
2021-03-22T16:06:10.2506147Z Version : 2.170.1
2021-03-22T16:06:10.2506357Z Author : Microsoft Corporation
2021-03-22T16:06:10.2506671Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/vstest
2021-03-22T16:06:10.2507003Z ==============================================================================
2021-03-22T16:06:13.2206826Z SystemVssConnection exists true
2021-03-22T16:06:13.2211470Z SystemVssConnection exists true
2021-03-22T16:06:13.2688355Z Running tests using vstest.console.exe runner.
2021-03-22T16:06:13.2688692Z ======================================================
2021-03-22T16:06:13.2689734Z Test selector : Test assemblies
2021-03-22T16:06:13.2690250Z Test filter criteria : null
2021-03-22T16:06:13.2690817Z Search folder : C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\s
2021-03-22T16:06:13.3105445Z Action when minimum tests threshold not met : donothing
2021-03-22T16:06:13.3105799Z Minimum tests expected to be run: 0
2021-03-22T16:06:13.3106571Z VisualStudio version selected for test execution : latest
2021-03-22T16:06:13.3108658Z Attempting to find vstest.console from a visual studio installation with version [16.0,17.0).
2021-03-22T16:06:13.7036147Z Run in parallel : false
2021-03-22T16:06:13.7037039Z Run in isolation : false
2021-03-22T16:06:13.7037723Z Path to custom adapters : null
2021-03-22T16:06:13.7039748Z Other console options : null
2021-03-22T16:06:13.7040430Z Code coverage enabled : false
2021-03-22T16:06:13.7041498Z Diagnostics enabled : false
2021-03-22T16:06:13.7043388Z SystemVssConnection exists true
2021-03-22T16:06:13.7053373Z Run the tests locally using vstest.console.exe
2021-03-22T16:06:13.7053922Z ========================================================
2021-03-22T16:06:13.7264700Z Source filter: \release*test.dll,!
\obj*

2021-03-22T16:06:13.8732793Z ##[warning]No test sources found matching the given filter '
\release*test
.dll,!
*\obj**’
2021-03-22T16:06:13.8767037Z ##[section]Finishing: Test Assemblies
2021-03-22T16:06:13.9008609Z ##[section]Starting: Publish symbols path
2021-03-22T16:06:18.1321764Z ==============================================================================
2021-03-22T16:06:18.1322135Z Task : Index sources and publish symbols
2021-03-22T16:06:18.1322480Z Description : Index your source code and publish symbols to a file share or Azure Artifacts symbol server
2021-03-22T16:06:18.1322827Z Version : 2.172.0
2021-03-22T16:06:18.1323035Z Author : Microsoft Corporation
2021-03-22T16:06:18.1323362Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/index-sources-publish-symbols
2021-03-22T16:06:18.1323970Z ==============================================================================
2021-03-22T16:06:22.0152685Z Found 0 files.
2021-03-22T16:06:22.6055594Z ##[warning]No files selected for indexing.
2021-03-22T16:06:22.6597111Z ##[section]Finishing: Publish symbols path
2021-03-22T16:06:22.6730771Z ##[section]Starting: Publish Artifact
2021-03-22T16:06:32.0129602Z ==============================================================================
2021-03-22T16:06:32.0129957Z Task : Publish build artifacts
2021-03-22T16:06:32.0130258Z Description : Publish build artifacts to Azure Pipelines or a Windows file share
2021-03-22T16:06:32.0130549Z Version : 1.183.0
2021-03-22T16:06:32.0131687Z Author : Microsoft Corporation
2021-03-22T16:06:32.0132022Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/publish-build-artifacts
2021-03-22T16:06:32.0132479Z ==============================================================================
2021-03-22T16:06:33.4539403Z ##[warning]Directory ‘C:\SonarAgent\vsts-agent-win-x64-2.181.2 (1)_work\32\a’ is empty. Nothing will be added to build artifact ‘drop’.
2021-03-22T16:06:33.4543787Z ##[section]Finishing: Publish Artifact
2021-03-22T16:06:33.4726418Z ##[section]Starting: Checkout SampleRepo@main to s
2021-03-22T16:06:33.4757633Z ==============================================================================
2021-03-22T16:06:33.4757932Z Task : Get sources
2021-03-22T16:06:33.4758214Z Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2021-03-22T16:06:33.4758497Z Version : 1.0.0
2021-03-22T16:06:33.4758700Z Author : Microsoft
2021-03-22T16:06:33.4758986Z Help : More Information
2021-03-22T16:06:33.4759322Z ==============================================================================
2021-03-22T16:06:34.1711937Z Cleaning any cached credential from repository: SampleRepo (Git)
2021-03-22T16:06:34.1933667Z ##[section]Finishing: Checkout SampleRepo@main to s
2021-03-22T16:06:34.2226510Z ##[section]Starting: Finalize Job
2021-03-22T16:06:34.2265633Z Cleaning up task key
2021-03-22T16:06:34.2267324Z Start cleaning up orphan processes.
2021-03-22T16:06:34.2325006Z ##[section]Finishing: Finalize Job
2021-03-22T16:06:34.2730548Z ##[section]Finishing: Agent job 1

@vishnu_G Did you check the logged output? All of the steps are green, but you have /p:SkipInvalidConfigurations=true, and the same warnings are appearing as in the previous builds about the invalid configuration:

The test step is green, but it looks like it didn’t find or run any tests:

… and it looks like no build artefacts were produced:

The original warning message from MSBuild suggests one possible solution is to build a solution file, if there is one. Have you tried that?

Hi Duncan,

I have repeated the steps of creation of new pipeline and adding the sonar tasks,
it working without issue.
In Past, i tried with the code which i downloaded from github where i missed some assemblies and references.
But after pulling the code directly from github to Azure repo and using the code in the pipeline fixed the issue without any failure.

I hope we can have close the thread
A big thanks for all your support slight_smile: .

1 Like

@vishnu_G thanks for the update. Glad you got it working!

1 Like