When will there be support for .Net Core 3 in SonarScanner for Azure DevOps?

Hi,
We are using Azure DevOps and SonarScanner extension.
I saw this info-text on the extension site:
“The extension embeds its own version of the SonarScanner for MSBuild.”

When will the new updated version 4.8.0 (https://github.com/SonarSource/sonar-scanner-msbuild/releases/tag/4.8.0.12008) be used in the extension?

Hi @Mathias_Skold_Strand and welcome to the community !

Version 4.8 of the Scanner for MSBuild is embedded since version 1.10 of the extension.

Mickaël

1 Like

Hi,
Thanks for the answer!

Then there are some other problems with using .Net core 3.1 projects (which are recommended by Microsoft on this page: https://dotnet.microsoft.com/download/dotnet-core).

We use Azure DevOps with SonarCloud.

Other ideas regarding this?

Could you please be a bit more precise on which kind of error do you encounter ?

Thanks.

Hi,

(While looking at the log I realized that one of the links did not work: https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-azure-devops)

Here are the logs:
2020-02-20T08:31:49.0351301Z ##[section]Starting: prepare analysis on sonarcloud
2020-02-20T08:31:49.0355399Z ==============================================================================
2020-02-20T08:31:49.0355528Z Task : Prepare Analysis Configuration
2020-02-20T08:31:49.0355599Z Description : Prepare SonarCloud analysis configuration
2020-02-20T08:31:49.0355689Z Version : 1.10.0
2020-02-20T08:31:49.0355736Z Author : sonarsource
2020-02-20T08:31:49.0355788Z Help : Version: 1.10.0. More Information
2020-02-20T08:31:49.0355890Z ==============================================================================
2020-02-20T08:31:49.5481738Z SYSTEMVSSCONNECTION exists true
2020-02-20T08:31:49.9210690Z [command]/opt/hostedtoolcache/dncs/3.1.101/x64/dotnet /home/vsts/work/_tasks/SonarCloudPrepare_xxxxxxxxxxxxxxxxx/1.10.0/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll begin /k:Workplace-Domain /o:xxxxxxxxxxx
2020-02-20T08:31:49.9405817Z ##[error]It was not possible to find any compatible framework version
The framework ‘Microsoft.NETCore.App’, version ‘2.0.0’ was not found.

  • The following frameworks were found:
    3.1.1 at [/opt/hostedtoolcache/dncs/3.1.101/x64/shared/Microsoft.NETCore.App]
    You can resolve the problem by installing the specified framework and/or SDK.
    The specified framework can be found at:
  • https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=ubuntu.16.04-x64
    2020-02-20T08:31:49.9406374Z It was not possible to find any compatible framework version
    2020-02-20T08:31:49.9406788Z The framework ‘Microsoft.NETCore.App’, version ‘2.0.0’ was not found.
    2020-02-20T08:31:49.9407078Z - The following frameworks were found:
    2020-02-20T08:31:49.9407144Z 3.1.1 at [/opt/hostedtoolcache/dncs/3.1.101/x64/shared/Microsoft.NETCore.App]
    2020-02-20T08:31:49.9407189Z
    2020-02-20T08:31:49.9407291Z You can resolve the problem by installing the specified framework and/or SDK.
    2020-02-20T08:31:49.9407342Z
    2020-02-20T08:31:49.9407709Z The specified framework can be found at:
    2020-02-20T08:31:49.9408365Z - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.0.0&arch=x64&rid=ubuntu.16.04-x64
    2020-02-20T08:31:49.9409998Z ##[error]The process ‘/opt/hostedtoolcache/dncs/3.1.101/x64/dotnet’ failed with exit code 150
    2020-02-20T08:31:49.9445344Z ##[section]Finishing: prepare analysis on sonarcloud

(While looking at the log I realized that one of the links did not work: https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-azure-devops)

You should add a trailing forward slash in the url, this works.

For the rest, indeed, we haven’t yet shipped the full dotnet core 3 new assembly in the extension, this will be done soon, i created a ticket : https://jira.sonarsource.com/browse/VSTS-230

In the mean time and as a workaround, you can invoke the scanner for msbuild in command line, using the dotnet core 3 assembly.

Sorry for the inconvenience !

Mickaël

Hi,

Thanks for all the replies!

Regards

Just wondering any updated on .netcore3.x support?

here is the workaround I used for the mean time! may help others.

  1. Install .net sdk 2.x (using .NET Core Tool Installer)
  2. Prepare Analysis Configuration
  3. Install .net sdk 3.x (using .NET Core Tool Installer)
  4. Build your application (which is targeting netcore3.x)
  5. Test your application (which is targeting netcore3.x)
  6. Install .net sdk 2.x (using .NET Core Tool Installer)
  7. Run Code Analysis
  8. Publish Quality Gate Result

verify in SonarQube project the analysis as part of build is posted.