Home > OS >  .NET Core 2.1 Azure Functions won't build in Azure Pipelines
.NET Core 2.1 Azure Functions won't build in Azure Pipelines

Time:03-04

I keep getting this error when I try to run the pipelines for my azure backend functions:

[error]C:\Users\VssAdministrator.nuget\packages\microsoft.net.sdk.functions\1.0.27\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(41,5): Error : It was not possible to find any compatible framework version

The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.

It's a pretty old program, but yesterday was the first time that the build has failed and I don't know how to fix it. It happens both in the develop and main branch so I'm guessing it's a change from Azure.

CodePudding user response:

As documented in this GitHub issue .NET Core 2.1 has been removed from all build agent images.

Possible impact

If your project depends on a pre-installed .Net 2.1 it can be broken.

You can try to use the setup dotnet task to explicitly install .NET Core 2.1.

- uses: actions/setup-dotnet@v1
  with:
    dotnet-version: '2.1.x'

Please be advised .NET Core 2.1 has been out of support since August 21, 2021 (see .NET and .NET Core Support Policy). An upgrade to a currently supported version like .NET Core 3.1 or higher should not be a lot of work and is well worth the effort.

Chart showing .NET Core 3.1 as an LTS release that happened in December 2019 and all other releases happening in November starting with .NET 5 and intercalating between Current and LTS

  • Related