Azure DevOps Pipeline VsBuild 不适用于 Azure Function v2
我正在尝试使用 Azure DevOps 发布我的应用程序。我在同一个存储库上有 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 函数)
<TargetFramework>netstandard2.0</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
有人有想法让这个构建工作吗?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要解决此问题
##[错误]C:\Users\VssAdministrator\.nuget\packages\microsoft.net.sdk.functions\1.0.29\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build .targets(41,5):错误:无法找到任何兼容的框架版本
错误:确保您的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/dotnet/core/issues/3487
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/dotnet/core/issues/3487