繁体   English   中英

Azure DevOps 管道 VsBuild 不适用于 Azure Function v2

[英]Azure DevOps Pipeline VsBuild dont work with Azure Function v2

我正在尝试使用 Azure DevOps 发布我的应用程序。 我在同一个 repo 上有 2 个 Azure 函数(v2 和 3)、1 个 web 应用程序和 2 个“库项目”(.net Framework 4)。 所以这是我第一次接触 DevOps,真的很难......

我在构建时遇到问题。 我使用 VSBuild 任务同时构建所有项目。 这是我的 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'

这里的错误:

##[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

并在项目的 csproj 中(Azure Function)

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

有人有想法让这个构建工作吗?

要解决此##[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错误:

确保您的1 web 应用程序2 个库项目都具有相同版本的Microsoft.NET.Sdk.Functions 1.0.29

参考资料: https://github.com/Azure/azure-functions-vs-build-sdk/issues/199#issuecomment-665776934找不到兼容的框架版本。 找不到指定的框架“Microsoft.NETCore.App”,版本“2.2.0”https://github.com/do.net/core/issues/3487

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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