I have a build pipeline configured for a Service Fabric solution on Azure DevOps like this:
Everything was fine until a few days ago when the build started failing on a particular build agent (private), with the following error (for a few projects):
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.
The failing task is the Build solution $(PathToSolution)
one.
The weird thing is that the build fails when running on some agents but with others the build is fine.
Some details:
Use NuGet 4.x
task started using NuGet v4.9.1 very recently, I think. I tried using v4.8.1 with no luck;- Most of the projects use the
PackageReference
format, but the.sfproj
project uses thepackages.config
file - I tried using the
dotnet restore
task but there is an error when trying to restore the packages for the.sfproj
project:`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
Any idea on what might be causing this issue?
.tfignore
/.gitignore
(depending on which you're using for source control) that excludes thebin
,obj
, andpackages
folders? Can you confirm that these folders are not in source control? – Daniel Mann.gitignore
file in the root folder. I believe it is the default one for Visual Studio with some minro changes. Yes there are rules for thebin
,obj
and**/packages/*
(nuget) – Rui Jarimba.gitignore
and accidentally commit them to source control? – Daniel Mann