.net-core - .NET Core 3.1 应用程序不再构建在 Azure 管道上 (.NET 5)

标签 .net-core azure-devops azure-pipelines .net-core-3.1 .net-5

直到最近,我们的 .Net Core 3.1 应用程序还在 Azure 管道上构建和发布良好。但是在过去的几天里,构建管道开始失败并出现错误:

##[error]C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): 
Error NETSDK1005: Assets file 'D:\a\1\s\ProjectFolder\src\Project\obj\project.assets.json' doesn't have a target for 'netcoreapp3.1'. 
Ensure that restore has run and that you have included 'netcoreapp3.1' in the TargetFrameworks for your project.
(ResolvePackageAssets target) -> 
  C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): 
error NETSDK1005: Assets file 'D:\a\1\s\ProjectFolder\src\Project\obj\project.assets.json' doesn't have a target for 'netcoreapp3.1'. 
Ensure that restore has run and that you have included 'netcoreapp3.1' in the TargetFrameworks for your project. [D:\a\1\s\ProjectFolder\src\Project\Project.csproj]
对于失败的解决方案构建步骤,构建管道设置如下。
Build configuration - using latest, but setting to VS 2019 also fails.
任何想法如何以最少的更改解决此问题?

最佳答案

.NET Core 3.1 application not building on Azure pipeline anymore (.NET 5)


请尝试更新 nuget.exe5.8.0按任务NuGet tool installer :
enter image description here
您可以查看 this thread了解更多详情。

关于.net-core - .NET Core 3.1 应用程序不再构建在 Azure 管道上 (.NET 5),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64923292/

相关文章:

c# - EF Core 3.0 替换 IMutableIndex.Npgsql() 方法

azure - 如何小写 Azure DevOps 管道变量名称

azure - 如何从 Azure Web 应用服务部署中心获取信息

azure - Azure Devops for Function App 中的交换槽任务

azure-devops - 在管道构建期间获取 sql server (express) azure devops

Azure 开发运营 : Copying files to az fileshare very slow

.net-core - 将 Serilog 与 .Net core 和 App Insights 结合使用

.net - RabbitMQ .NET 客户端中的奇怪 "No ip address could be resolved"

azure - Azure Functions 中的服务总线死信队列处理

asp.net - Docker 无法使用 "error MSB1001"在 Azure Pipelines 中构建