Torben Nielsen
Torben Nielsen

Reputation: 833

How do I force my Azure pipeline to build with .NET 5.0?

We have started migrating some of our libraries to net 5.0, and need to build these in an Azure pipeline.

Our pipelines are set up to use a specific SDK version, using the step "Use .NET Core SDK". This step fails when we specify version 5.0.101.

enter image description here

It fails with this error

Tool to install .NET Core SDK version 5.0.101. ##[error]Failed to download or parse releases-index.json with error: {"errno":"ENOTFOUND","code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"dotnetcli.blob.core.windows.net","host":"dotnetcli.blob.core.windows.net","port":443} Finishing: Use .NET Core SDK 5.0.101

Upvotes: 2

Views: 1810

Answers (2)

Harshita Singh
Harshita Singh

Reputation: 4870

I think this is similar to GitHub issue #10969. It has something to do with internal GitHub repo/url. This is because the version which we specify in the task is searched in releases-index file, which is accessible to public as well:

enter image description here

releases-index:

{
    "releases-index": [
        {
            "channel-version": "5.0",
            "latest-release": "5.0.1",
            "latest-release-date": "2020-12-08",
            "security": false,
            "latest-runtime": "5.0.1",
            "latest-sdk": "5.0.101",
            "product": ".NET",
            "support-phase": "current",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/5.0/releases.json"
        },
        {
            "channel-version": "3.1",
            "latest-release": "3.1.10",
            "latest-release-date": "2020-11-10",
            "security": false,
            "latest-runtime": "3.1.10",
            "latest-sdk": "3.1.404",
            "product": ".NET Core",
            "support-phase": "lts",
            "eol-date": "2022-12-03",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json"
        },
        {
            "channel-version": "3.0",
            "latest-release": "3.0.3",
            "latest-release-date": "2020-02-18",
            "security": false,
            "latest-runtime": "3.0.3",
            "latest-sdk": "3.0.103",
            "product": ".NET Core",
            "support-phase": "eol",
            "eol-date": "2020-03-03",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.0/releases.json"
        },
        {
            "channel-version": "2.1",
            "latest-release": "2.1.23",
            "latest-release-date": "2020-10-13",
            "security": false,
            "latest-runtime": "2.1.23",
            "latest-sdk": "2.1.811",
            "product": ".NET Core",
            "support-phase": "lts",
            "eol-date": "2021-08-21",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json"
        },
        {
            "channel-version": "2.2",
            "latest-release": "2.2.8",
            "latest-release-date": "2019-11-19",
            "security": true,
            "latest-runtime": "2.2.8",
            "latest-sdk": "2.2.207",
            "product": ".NET Core",
            "support-phase": "eol",
            "eol-date": "2019-12-23",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json"
          },
        {
            "channel-version": "2.0",
            "latest-release": "2.0.9",
            "latest-release-date":"2018-07-10",
            "security": true,
            "latest-runtime": "2.0.9",
            "latest-sdk": "2.1.202",
            "product": ".NET Core",
            "support-phase": "eol",
            "eol-date": "2018-10-01",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.0/releases.json"
        },
        {
            "channel-version": "1.1",
            "latest-release": "1.1.13",
            "latest-release-date": "2019-05-14",
            "security": true,
            "latest-runtime": "1.1.13",
            "latest-sdk": "1.1.14",
            "product": ".NET Core",
            "support-phase": "eol",
            "eol-date": "2019-06-27",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/1.1/releases.json"
        },
        {
            "channel-version": "1.0",
            "latest-release": "1.0.16",
            "latest-release-date": "2019-05-14",
            "security": true,
            "latest-runtime": "1.0.16",
            "latest-sdk": "1.1.14",
            "product": ".NET Core",
            "support-phase": "eol",
            "eol-date": "2019-06-27",
            "releases.json": "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/1.0/releases.json"
        }
    ]
}

And, if you check, https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/5.0/releases.json is accessible publicly as well. Hence, I am of the conviction that the URL mentioned internally is wrong and hence the agent throws NOT FOUND error.

In this case, I would recommend you to reopen Issue #10969 and inform the product team.

Upvotes: 1

Camilo Terevinto
Camilo Terevinto

Reputation: 32072

Well, the SDK 5.0.101 isn't yet available in Azure Pipelines, as you can see in the accepted values: https://github.com/dotnet/core/blob/master/release-notes/releases-index.json

If you just want to use 5.0, use:

- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '5.x'

Upvotes: 1

Related Questions