I am implementing a pipeline to run sonnar-scaner to a .NET project. I already have a service connection in azure where I have my instance for sonar.
I don’t want to use MsBuild in scanner-mode, can I use CLI? And what would be the process to send the token and to install dotnet? What else should I consider if I don’t want to use the MsBuild scanner mode. thank you
Hello ,thanks for your answer, I already managed to deploy the pipeline and if it runs successfully but it is not analyzing the .cs files that are the most important, what can I do?
2023-08-18T02:16:53.2103385Z ##[section]Starting: SonarQubeAnalyze
2023-08-18T02:16:53.2107104Z ==============================================================================
2023-08-18T02:16:53.2107222Z Task : Run Code Analysis
2023-08-18T02:16:53.2107286Z Description : Run scanner and upload the results to the SonarQube server.
2023-08-18T02:16:53.2107397Z Version : 5.15.0
2023-08-18T02:16:53.2107454Z Author : sonarsource
2023-08-18T02:16:53.2107514Z Help : Version: 5.15.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2023-08-18T02:16:53.2107742Z ==============================================================================
2023-08-18T02:16:53.6145028Z [command]/usr/bin/dotnet /__w/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/5.15.0/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll end
2023-08-18T02:16:53.7026189Z SonarScanner for MSBuild 5.13
2023-08-18T02:16:53.7027507Z Using the .NET Core version of the Scanner for MSBuild
2023-08-18T02:16:53.7735487Z Post-processing started.
2023-08-18T02:16:53.8618955Z ##[error]02:16:53.854 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 steps
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 have a valid ProjectGuid and you have not used a solution (.sln)
2023-08-18T02:16:53.8641458Z 02:16:53.854 The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
2023-08-18T02:16:53.8641732Z Possible causes:
2023-08-18T02:16:53.8642163Z 1. The project has not been built - the project must be built in between the begin and end steps
2023-08-18T02:16:53.8642434Z 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
2023-08-18T02:16:53.8642690Z 3. The begin, build and end steps have not all been launched from the same folder
2023-08-18T02:16:53.8642922Z 4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
2023-08-18T02:16:53.8643265Z 02:16:53.855 Generation of the sonar-properties file failed. Unable to complete the analysis.
2023-08-18T02:16:53.8644006Z ##[error]02:16:53.859 Post-processing failed. Exit code: 1
2023-08-18T02:16:53.8644507Z 02:16:53.859 Post-processing failed. Exit code: 1
2023-08-18T02:16:53.8692067Z ##[error]The process '/usr/bin/dotnet' failed with exit code 1
2023-08-18T02:16:53.8917273Z ##[section]Finishing: SonarQubeAnalyze
2023-08-18T21:16:32.9131367Z ##[section]Starting: Build
2023-08-18T21:16:32.9138112Z ==============================================================================
2023-08-18T21:16:32.9138229Z Task : .NET Core
2023-08-18T21:16:32.9138295Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2023-08-18T21:16:32.9138406Z Version : 2.221.0
2023-08-18T21:16:32.9138462Z Author : Microsoft Corporation
2023-08-18T21:16:32.9138539Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2023-08-18T21:16:32.9138649Z ==============================================================================
2023-08-18T21:16:33.5050464Z Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
2023-08-18T21:16:33.5095113Z [command]/usr/bin/dotnet build /__w/7/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln -dl:CentralLogger,"/__w/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/__w/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" --configuration Release
2023-08-18T21:16:33.6517249Z MSBuild version 17.3.2+561848881 for .NET
2023-08-18T21:16:33.7827080Z ##[error]config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln(0,0): Error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 12.0, inclusive.
2023-08-18T21:16:33.7837142Z /__w/7/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln : Solution file error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 12.0, inclusive.
2023-08-18T21:16:33.7837370Z
2023-08-18T21:16:33.7837482Z Build FAILED.
2023-08-18T21:16:33.7837571Z
2023-08-18T21:16:33.7837818Z /__w/7/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln : Solution file error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 12.0, inclusive.
2023-08-18T21:16:33.7838085Z 0 Warning(s)
2023-08-18T21:16:33.7838225Z 1 Error(s)
2023-08-18T21:16:33.7838280Z
2023-08-18T21:16:33.7838419Z Time Elapsed 00:00:00.02
2023-08-18T21:16:33.8060521Z ##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1
2023-08-18T21:16:33.8061931Z ##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
2023-08-18T21:16:33.8078182Z Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
2023-08-18T21:16:33.8079851Z ##[error]Dotnet command failed with non-zero exit code on the following projects : [ '/__w/7/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln' ]
2023-08-18T21:16:33.8237457Z ##[section]Finishing: Build
2023-08-22T14:15:46.5646592Z ##[section]Starting: MSBuild
2023-08-22T14:15:46.5651688Z ==============================================================================
2023-08-22T14:15:46.5651817Z Task : MSBuild
2023-08-22T14:15:46.5651877Z Description : Build with MSBuild
2023-08-22T14:15:46.5651962Z Version : 1.217.0
2023-08-22T14:15:46.5652019Z Author : Microsoft Corporation
2023-08-22T14:15:46.5652086Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/msbuild
2023-08-22T14:15:46.5652193Z ==============================================================================
2023-08-22T14:15:47.0698717Z [command]/usr/bin/xbuild /__w/1/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln
2023-08-22T14:15:47.1251696Z
2023-08-22T14:15:47.1253927Z >>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
2023-08-22T14:15:47.1254132Z
2023-08-22T14:15:47.1254416Z XBuild Engine Version 14.0
2023-08-22T14:15:47.1254662Z Mono, Version 6.8.0.105
2023-08-22T14:15:47.1255133Z Copyright (C) 2005-2013 Various Mono authors
2023-08-22T14:15:47.2034119Z
2023-08-22T14:15:47.2039018Z Build started 08/22/2023 14:15:47.
2023-08-22T14:15:47.2039413Z __________________________________________________
2023-08-22T14:15:47.3894367Z /__w/1/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln: warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
2023-08-22T14:15:47.4491021Z Project "/__w/1/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln" (default target(s)):
2023-08-22T14:15:47.4508255Z Target ValidateSolutionConfiguration:
2023-08-22T14:15:47.4508834Z Building solution configuration "Debug|Any CPU".
2023-08-22T14:15:47.4981698Z Target Build:
2023-08-22T14:15:47.4982151Z Project "/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.csproj" (default target(s)):
2023-08-22T14:15:47.4982381Z Target PrepareForBuild:
2023-08-22T14:15:47.4982559Z Configuration: Debug Platform: AnyCPU
2023-08-22T14:15:47.6720669Z Target CopyNonResxEmbeddedResources:
2023-08-22T14:15:47.6722227Z Copying file from '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/Referencias/Configurations.xml' to '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.Referencias.Configurations.xml'
2023-08-22T14:15:47.6727044Z Copying file from '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/Referencias/MailLayout.html' to '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.Referencias.MailLayout.html'
2023-08-22T14:15:47.6738188Z Target GenerateSatelliteAssemblies:
2023-08-22T14:15:47.6738636Z No input files were specified for target GenerateSatelliteAssemblies, skipping.
2023-08-22T14:15:47.6868701Z Target CoreCompile:
2023-08-22T14:15:47.6872657Z Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:full /debug:portable /optimize- /out:obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.dll /resource:obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.Referencias.Configurations.xml /resource:obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.Referencias.MailLayout.html ConfigurationData.cs ExcelExit.cs ExcelExit.Designer.cs MailManager.cs Map.cs Properties/AssemblyInfo.cs obj/Debug/.NETFramework,Version=v4.6.1.AssemblyAttribute.cs /target:library /define:"DEBUG;TRACE" /nostdlib /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.IPS.Functions.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.IPS.SIT.Common.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.IPS.SIT.ORM.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.IPS.SIT.StartMaps.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.IPS.SIT.Structures.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.SI.PGA.Core.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.SI.PGA.Formats.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Carvajal.SI.PGA.Interop.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/Excel.dll /reference:/usr/lib/mono/4.6.1-api/ICSharpCode.SharpZipLib.dll /reference:/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/log4net.dll /reference:/usr/lib/mono/4.6.1-api/System.dll /reference:/usr/lib/mono/4.6.1-api/System.Xml.Linq.dll /reference:/usr/lib/mono/4.6.1-api/System.Data.DataSetExtensions.dll /reference:/usr/lib/mono/4.6.1-api/System.Data.dll /reference:/usr/lib/mono/4.6.1-api/System.Xml.dll /reference:/usr/lib/mono/4.6.1-api/System.Core.dll /reference:/usr/lib/mono/4.6.1-api//mscorlib.dll /warn:4
2023-08-22T14:15:47.9657731Z Map.cs(828,30): warning CS0168: The variable `exc' is declared but never used
2023-08-22T14:15:47.9658259Z Map.cs(944,30): warning CS0168: The variable `ex' is declared but never used
2023-08-22T14:15:47.9684147Z Map.cs(1234,21): warning CS0219: The variable `formateado' is assigned but its value is never used
2023-08-22T14:15:48.0511483Z Target _CopyDeployFilesToOutputDirectoryPreserveNewest:
2023-08-22T14:15:48.0512409Z Skipping target "_CopyDeployFilesToOutputDirectoryPreserveNewest" because its outputs are up-to-date.
2023-08-22T14:15:48.0603907Z Target DeployOutputFiles:
2023-08-22T14:15:48.0606227Z Copying file from '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.dll.mdb' to '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.dll.mdb'
2023-08-22T14:15:48.0607216Z Copying file from '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.pdb' to '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.pdb'
2023-08-22T14:15:48.0617177Z Copying file from '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/obj/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.dll' to '/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/bin/Debug/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.dll'
2023-08-22T14:15:48.0825541Z Done building project "/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.csproj".
2023-08-22T14:15:48.0833437Z The project 'TEST' is disabled for solution configuration 'Debug|Any CPU'.
2023-08-22T14:15:48.0842906Z Done building project "/__w/1/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln".
2023-08-22T14:15:48.0843073Z
2023-08-22T14:15:48.0855920Z Build succeeded.
2023-08-22T14:15:48.0856422Z
2023-08-22T14:15:48.0856718Z Warnings:
2023-08-22T14:15:48.0856841Z
2023-08-22T14:15:48.0857699Z /__w/1/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln: warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
2023-08-22T14:15:48.0857970Z
2023-08-22T14:15:48.0858310Z /__w/1/s/config/SI.SLN.MX.EDGEWELL_MORPHO.ORDERS.sln (default targets) ->
2023-08-22T14:15:48.0858657Z (Build target) ->
2023-08-22T14:15:48.0859134Z /__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.csproj (default targets) ->
2023-08-22T14:15:48.0859847Z /usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->
2023-08-22T14:15:48.0860019Z
2023-08-22T14:15:48.0860512Z Map.cs(828,30): warning CS0168: The variable `exc' is declared but never used
2023-08-22T14:15:48.0861081Z Map.cs(944,30): warning CS0168: The variable `ex' is declared but never used
2023-08-22T14:15:48.0862063Z Map.cs(1234,21): warning CS0219: The variable `formateado' is assigned but its value is never used
2023-08-22T14:15:48.0862252Z
2023-08-22T14:15:48.0862485Z 4 Warning(s)
2023-08-22T14:15:48.0862698Z 0 Error(s)
2023-08-22T14:15:48.0862809Z
2023-08-22T14:15:48.0863089Z Time Elapsed 00:00:00.8818940
2023-08-22T14:15:48.1861579Z ##[section]Finishing: MSBuild
but in the SonarQubeAnalyze@5.15.0 task I get this error :
2023-08-22T14:15:48.1878254Z ##[section]Starting: SonarQubeAnalyze
2023-08-22T14:15:48.1882586Z ==============================================================================
2023-08-22T14:15:48.1882730Z Task : Run Code Analysis
2023-08-22T14:15:48.1882799Z Description : Run scanner and upload the results to the SonarQube server.
2023-08-22T14:15:48.1882902Z Version : 5.15.0
2023-08-22T14:15:48.1882983Z Author : sonarsource
2023-08-22T14:15:48.1883051Z Help : Version: 5.15.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2023-08-22T14:15:48.1883278Z ==============================================================================
2023-08-22T14:15:48.6708467Z [command]/usr/bin/dotnet /__w/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/5.15.0/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll end
2023-08-22T14:15:48.7365992Z SonarScanner for MSBuild 5.13
2023-08-22T14:15:48.7366537Z Using the .NET Core version of the Scanner for MSBuild
2023-08-22T14:15:48.8051228Z Post-processing started.
2023-08-22T14:15:48.8891435Z ##[error]14:15:48.884 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 steps
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 have a valid ProjectGuid and you have not used a solution (.sln)
2023-08-22T14:15:48.8905431Z 14:15:48.884 The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
2023-08-22T14:15:48.8905694Z Possible causes:
2023-08-22T14:15:48.8907605Z 1. The project has not been built - the project must be built in between the begin and end steps
2023-08-22T14:15:48.8907981Z 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
2023-08-22T14:15:48.8908228Z 3. The begin, build and end steps have not all been launched from the same folder
2023-08-22T14:15:48.8908462Z 4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
2023-08-22T14:15:48.8908849Z 14:15:48.884 Generation of the sonar-properties file failed. Unable to complete the analysis.
2023-08-22T14:15:48.8909783Z ##[error]14:15:48.889 Post-processing failed. Exit code: 1
2023-08-22T14:15:48.8910338Z 14:15:48.889 Post-processing failed. Exit code: 1
2023-08-22T14:15:48.8992033Z ##[error]The process '/usr/bin/dotnet' failed with exit code 1
2023-08-22T14:15:48.9137124Z ##[section]Finishing: SonarQubeAnalyze
If your project is meant to be using xbuild (which appears to be a very old build tool that hasn’t been maintained in almost a decade)… I don’t think you’re going to have much luck. The Scanner for .NET has never been tested with xbuild, and it looks like its last release was even before Microsoft’s Roslyn compiler shipped, which is what our analyzers are based on.
I suggest finding out more about this project to understand why xbuild is being used and if there’s a way to build the project with modern build tools, which are more likely to work with SonarQube.
If I use xbuild (mono in my docker image ) it does the build , but now with msbuild I get this error, in the build task, it refers to the NET version.
Task : .NET Core
Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
Version : 2.221.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
==============================================================================
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
/usr/bin/dotnet build /__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.csproj -dl:CentralLogger,"/__w/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/__w/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
Microsoft (R) Build Engine version 17.0.1+b177f8fa7 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
##[error]/usr/lib/dotnet/sdk/6.0.121/Microsoft.Common.CurrentVersion.targets(1217,5): Error MSB3644: The reference assemblies for .NETFramework,Version=v3.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
/usr/lib/dotnet/sdk/6.0.121/Microsoft.Common.CurrentVersion.targets(1217,5): error MSB3644: The reference assemblies for .NETFramework,Version=v3.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.csproj]
Build FAILED.
/usr/lib/dotnet/sdk/6.0.121/Microsoft.Common.CurrentVersion.targets(1217,5): error MSB3644: The reference assemblies for .NETFramework,Version=v3.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/__w/1/s/config/SI.MX.EDGWELL_MORPHO.ORDERS.XLSX.TXT/SI.MX.EDGEWELL_MORPHO.ORDERS.XLSX.TXT.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.74
##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
@Colin I have tried to replicate what is done in windows locally, since locally only with the .properties file and running the sonarscaner it is possible to do the correct analysis.
INFO: Download sonar-python-plugin-1.8.0.1496.jar
INFO: Download sonar-typescript-plugin-1.9.0.3766.jar
INFO: Download sonar-xml-plugin-2.0.1.2020.jar
INFO: Download sonar-scm-svn-plugin-1.8.0.1168.jar
INFO: Process project properties
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2.288s
INFO: Final Memory: 7M/54M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.sources
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: Error during SonarScanner execution
ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.sources
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
##[error]The process '/__w/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/5.15.0/sonar-scanner/bin/sonar-scanner' failed with exit code 2
Finishing: SonarQubeAnalyze
SonarQube v6.7 is an EOL version of SonarQube with no support. You need to use a recent version of SonarQube, v9.9 LTS or v10.1
It’s not possible to analyze .NET files with the Scanner CLI. You need to build it with MSBuild and use the Scanner for .NET.
Your project needs to be compiled with a “recent” version of MSBuild (as documented, 14.0 or greater), although the build can still target old framework versions
Helping you get your build working on MSBuild for this specific project is out of scope for this community. However – if you accomplish that and upgrade to a supported version of SonarQube, it should be easy to integrate SonarQube analysis.