bit0001
bit0001

Reputation: 555

DevOps hosted pipeline fail to build .NET Core 2.2

With the release of .NET Core 2.2 I expected to be able to build such projects in our Microsoft-hosted DevOps (Azure) pipeline. But the restore step fails, saying 2.2 is not supported:

2018-12-11T14:57:49.0856135Z        "D:\a\1\s\My.Project\My.Project.csproj" (Restore target) (1) ->
2018-12-11T14:57:49.0857867Z        "D:\a\1\s\MyProject.EntityFramework\MyProject.EntityFramework.csproj" (_GenerateRestoreGraphProjectEntry target) (2:3) ->
2018-12-11T14:57:49.0858029Z        (_CheckForUnsupportedNETCoreVersion target) -> 
2018-12-11T14:57:49.0858191Z          C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2.  Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. [D:\a\1\s\MyProject.EntityFramework\MyProject.EntityFramework.csproj]
2018-12-11T14:57:49.0858287Z 
2018-12-11T14:57:49.0858338Z 
2018-12-11T14:57:49.0858398Z        "D:\a\1\s\My.Project\My.Project.csproj" (Restore target) (1) ->
2018-12-11T14:57:49.0858504Z        "D:\a\1\s\My.Project\My.Project.csproj" (_GenerateRestoreGraphProjectEntry target) (1:5) ->
2018-12-11T14:57:49.0858645Z          C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2.  Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. [D:\a\1\s\My.Project\My.Project.csproj]

The project builds fine locally, so I think it is most likely that I'm missing something - especially as I come up with nothing on my internet search for similar errors.

Could it really be it is not supported yet?

Upvotes: 12

Views: 4854

Answers (4)

Fokko
Fokko

Reputation: 186

The answer of @bit0001 is correct. Microsoft has a list of supported versions that can be installed using this task. You can find those versions here.

As you can see, 2.1.500 is supported when installing the sdk, 2.1.0 is not, you'll need to use 2.1.300. When installing only the runtime, you can use 2.1.0. Currently, the latest 2.2 version supported is 2.2.100.

Upvotes: 1

Mykola Kotsabiuk
Mykola Kotsabiuk

Reputation: 111

I had the same problem with my pipeline. Here is the solution:

  1. Add to your job (press plus button) in the pipeline task .NET Core SDK Installer. You can search for it in a search box Task adding

  2. Make sure to put that task on the top of your job. You can use drag&drop.

Put .Net SDK on the top

  1. Set up version of .Net Core SDK Installer at least the same your version.

Set up .Net Core SDK

You can see all available version by pressing on the "here" word the in the popup

Upvotes: 4

Y Kim
Y Kim

Reputation: 119

This does trick to my project:

steps:
- task: DotNetCoreInstaller@0
  displayName: 'Use .NET Core SDK Tool Installer'
  inputs:
    version: 2.2.100
- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

Upvotes: 5

bit0001
bit0001

Reputation: 555

OK, so there is a task ".NET Core Installer" that can be added before the Restore task, and by requesting 2.2.100 to be installed first of all the build passes.

Upvotes: 15

Related Questions