【发布时间】:2021-07-09 00:26:20
【问题描述】:
我正在尝试使用 Devops Pipeline (CI) 构建和部署 Azure Function
这是我的步骤
但是直到步骤 Publish 执行之前的一切都没有任何错误。但在发布级别我收到此错误(如上图所示)
Active code page: 65001
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Project file(s) matching the specified pattern were not found.
Finishing: Publish
我认为这是因为 .Net 版本,所以我在发布之前添加了 Use .NET 5.x 步骤。但它仍然会触发相同的错误。
这是这 3 个步骤的 Yaml
steps:
- task: DotNetCoreCLI@2 displayName: 'dotnet build' inputs:
projects: 'Toolset/ScheduledJobs/*.csproj'
steps:
- task: UseDotNet@2 displayName: 'Use .NET Core sdk 5.x' inputs:
version: 5.x
steps:
- task: DotNetCoreCLI@2 displayName: Publish inputs:
command: publish
publishWebProjects: false
projects: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingdirectory)/ScheduledJobs'
zipAfterPublish: false
modifyOutputPath: false
请让我知道我在那里做错了什么?
我在 VS 2019 中开发了 Azure Function (3.0)
【问题讨论】:
-
您没有为发布步骤指定包含项目的路径。查看您的构建步骤与发布步骤。
-
在 dotnet restore 之前移动也使用 .NET SDK 步骤。
标签: azure-devops azure-functions azure-pipelines .net-5