12

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?

8
  • 2
    2.1.402 there's yer problem
    – Matthew
    Commented Dec 11, 2018 at 15:28
  • 1
    Right, but this is Microsoft's hosted build agent in Azure. I don't have control over it but I expect MS to support latest and greatest.
    – bit0001
    Commented Dec 11, 2018 at 17:54
  • What image are you using in your pipeline?
    – Matthew
    Commented Dec 11, 2018 at 18:09
  • Microsof't canned "Hosted VS2017".
    – bit0001
    Commented Dec 11, 2018 at 18:35
  • 2.2 is not a LTS release, so it is latest but not the "greatest" dotnet.microsoft.com/platform/support-policy
    – Lex Li
    Commented Dec 13, 2018 at 21:59

4 Answers 4

15

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.

2
  • 3
    The task is now called ".NET Core SDK Installer" . For anyone looking for a valid version for 2.1, I found that 2.1.500 works. Surprised that neither 2.1.0 nor 2.2.0 exists. Commented Dec 12, 2018 at 16:21
  • What a PITA... firstly the hosted agent should have 2.2 installed already, and secondly Microsoft really need to surface things like this in the UI somehow - I shouldn't have to resort to Google and SO :/
    – Cocowalla
    Commented Feb 7, 2019 at 13:52
5

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)'
4

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

0
1

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.

2
  • Link is no longer valid
    – Lance
    Commented Jul 9, 2020 at 12:54
  • Fixed the link as requested by @lance
    – Fokko
    Commented Sep 8, 2020 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.