SonarCloud Azure DevOps extension 1.25 broken

Today a new version of SonarCloud Azure DevOps extension was installed (1.24 → 1.25), needless to say automatically, which has broken our builds:

We are using Azure hosted agents:

Pool: Azure Pipelines
Image: ubuntu 18.04
Agent: Azure Pipelines 7
Started: Today at 3:26 PM
Duration: 35s

We have following steps to install .net 2.1.x and 5.0.x:

  #TBD ugly workaround, fix once solved.
  # see
  # and
  - ${{ if eq(parameters.runSonarCloudAnalysis, true) }}:
    - task: UseDotNet@2
      displayName: 'Use .NET Core 2.0 SDK (SonarCloud)'
        packageType: sdk
        version: 2.x
        installationPath: $(Agent.ToolsDirectory)/dotnet

  - task: UseDotNet@2
    displayName: 'Use .NET sdk'
      packageType: sdk
      version: 5.x
      installationPath: $(Agent.ToolsDirectory)/dotnet

note the reasons why:

Hi Jan

The update was to remove the dependency on the unsupported .NET 2.0. You can read the announcement here



Hi @jvilimek

First, We apologize for this.

If you are using hosted agent, .NET Core 3.1 should be installed by default on the machines.

Can you please issue the following command during your build (if possible), and send us the output ?

dotnet --list-sdks

Thanks in advance.

the list of .net frameworks on the machine is listed on the error, it was 2.2.7 and 5.0.9.

we are building .net 5.0 apps, therefore we need to install the sdk as you see in the original post.

Following fixed the issue for us:

(not sure, if also removal of the install of .net core 2.x would solve it as well)

I see. So the need for the fix was to be expected = it was a breaking change :frowning:

I have searched for the “1.25” version in the forum, found nothing. Is there any changelog for the extension? Anyway, this is a breaking change, so it would be great to increase the major version next time. If not for the extension, then 100% for the task…

- task: SonarCloudAnalyze@2 #<---- this is the version I was refering to ...please upgrade this in case any future breaking changes!
  displayName: Run SonarQube analysis

Hi @jvilimek

We just saw the fact that using the “UseDotNetCore” task (which we were recommending as a workaround before) hides every other version of .NET Core SDK that are installed on the machine, that wasn’t expected on our side for sure.

I think you can pretty much safely remove it, as it should look after any 3.1 installed, and this is present in the ubuntu image you are using.


Yes indeed. However can we agree that change of the runtime, i.e. change from runtime .net core 2.x → 3.x is breaking? Can this be handled from your side better in the future? i.e. increasing the major version / version for the task as usual and expected by the other extensions? We are using tens of extensions for our Azure DevOps projects. Now the sonarcloud pipeline is integrated to tens of projects and hundreds of people depends on successful run of these pipelines. It is indeed really a big issue for us when such pipelines starts failing unexpectedly (i.e. because the new version of the extension installs automatically).

Can this be handled from your side better in the future = increasing major/extension version when doing breaking changes?

1 Like

Hi Jan

Yes I’m sorry for the problems this has caused. We thought the impact would be minor as .NET Core 3.1 SDK is installed on azure agents, but we hadn’t considered that the workaround for .NET Core 2.0 that uses the UseDotNet task would cause a problem. As you know we reacted late to .NET 2.0 going out of support and then didn’t have much time to consider the impact of the update. We’ve made some changes internally to ensure that the Scanner for .NET and associated extensions are better cared for from now on and we are planning to make improvements to both in the future. We’ll be careful with task versioning as you suggest.

Again apologies for breaking your builds!


Thanks a lot! Appreciated your kind answer.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.