我在 Azure DevOps 上为 Service Fabric 解决方案配置了一个构建管道,如下所示:
一切都很好,直到几天前构建开始在特定构建代理(私有(private))上失败,并出现以下错误(对于一些项目):
C:\Program Files\dotnet\sdk\2.1.200\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(327,5): Error : Assets file 'F:\Agent03\w\84\s\src\MyProject.Sam.Tiles.Domain\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
失败的任务是
Build solution $(PathToSolution)
一。奇怪的是在某些代理上运行时构建失败,但在其他代理上构建很好 .
一些细节:
Use NuGet 4.x
任务最近开始使用 NuGet v4.9.1,我想。我尝试使用 v4.8.1 没有运气; PackageReference
格式,但 .sfproj
项目使用 packages.config
文件 dotnet restore
任务,但尝试恢复 .sfproj
的包时出错项目:`Error : Unable to find the '....\packages\Microsoft.VisualStudio.Azure.Fabric.MSBuild.1.6.7\build\Microsoft.VisualStudio.Azure.Fabric.Application.props' file. Please restore the 'Microsoft.VisualStudio.Azure.Fabric.MSBuild' Nuget package
关于可能导致此问题的任何想法?
最佳答案
一些项目使用PackageReference
格式,但 .sfproj
项目使用 packages.config
文件。
我仍然不明白为什么构建开始失败,但我能够找到解决方法。鉴于 PackageReference
Service Fabric 项目尚不支持,我的解决方法是使用 两个恢复任务如下:
关于nuget - 在 Azure Devops 上运行构建时找不到 Assets 文件 project.assets.json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53544039/