失败的任务是“Build solution $(PathToSolution)”任务。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.
奇怪的是,“在某些代理上运行会导致构建失败,但在其他代理上构建正常”。
一些细节:
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” 文件。请恢复 “Microsoft.VisualStudio.Azure.Fabric.MSBuild” NuGet 包。
您有任何想法,是什么导致了这个问题?
.gitignore
文件。我相信它是Visual Studio的默认文件,经过了一些小的更改。是的,它包含了针对bin
、obj
和**/packages/*
(nuget)的规则。 - Rui Jarimba.gitignore
并意外地将它们提交到源代码控制吗? - Daniel Mann