Azure DevOps Pipeline VsBuild 不适用于 Azure Function v2

发布于 2025-01-10 14:00:29 字数 880 浏览 5 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜血染红嫁衣 2025-01-17 14:00:29

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文