Using .Net Core 2.2 in Azure DevOps

I recently had to restore and build a project in AzureDevOps that turned out to be currently not supported.

Resulting in the error message below:

“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. “

image

image

How I got around it was with the help of Scott Hanselmans blog post: https://www.hanselman.com/blog/AzureDevOpsContinuousBuildDeployTestWithASPNETCore22PreviewInOneHour.aspx

What I done was effectively add the SDK installer as a task as part of my build pipeline

image

and move it to the top of my build pipleline before the restore task as below

image

in my project I am building against SDK version 2.2.101 so I chose this in the “Version” textbox as below

image

Once I run again I get a clean bill of health

image

This is simple a quick way to get around SDK support in Azure DevOps.