When using azure pipelines to build my .NET 5 function I am getting the following error
##[error]/home/vsts/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): Error : It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '3.1.0' was not found.
- The following frameworks were found:
5.0.4 at [/opt/hostedtoolcache/dotnet/shared/Microsoft.NETCore.App]
This also displays a Error : Metadata generation failed
error further down the build script
##[error]/home/vsts/.nuget/packages/microsoft.net.sdk.functions/3.0.11/build/Microsoft.NET.Sdk.Functions.Build.targets(32,5): Error : Metadata generation failed.
My build script is
trigger:
- master
stages:
- stage: 'Build'
jobs:
- job:
pool:
vmImage: 'ubuntu-latest'
workspace:
clean: all
steps:
- task: UseDotNet@2
displayName: Use Dot Net Core 5.0.x
inputs:
packageType: 'sdk'
version: '5.0.x'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
arguments: '--configuration Release'
command: 'build'
projects: '**/*.csproj'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…