简体   繁体   中英

Azure DevOps Pipeline VsBuild dont work with Azure Function v2

I'm trying to publish my app with Azure DevOps. I have on the same repo 2 Azure functions (v2 and 3), 1 web application and 2 "libraries projects" (.net Framework 4). So it's my first time with DevOps and it's really hard...

I have a problem when building. I use a VSBuild task to build all the projects at the same time. Here my yaml:

- task: UseDotNet@2
  displayName: 'Use .NET SDK 2.1'
  inputs:
    packageType: 'sdk'
    version: '2.1.202' #I tried some others versions too
- task: VSBuild@1
  inputs:
    solution: 'project.sln'

Here the error:

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

And in the csproj of the project (Azure Function)

<TargetFramework>netstandard2.0</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>

Has someone an idea to make this build work?

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

Make sure your 1 web application and 2 libraries projects both have the same version of Microsoft.NET.Sdk.Functions 1.0.29 .

References: https://github.com/Azure/azure-functions-vs-build-sdk/issues/199#issuecomment-665776934 , It was not possible to find any compatible framework version. The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found and https://github.com/do.net/core/issues/3487

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM