Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "No file format header found." running NuGet restore

When I run

Nuget.exe restore [path]\packages.config -PackagesDirectory [path]\build\packages

it works as expected. However, the command

Nuget.exe restore [path]\bigpackages.config -PackagesDirectory [path]\build\packages

fails with the error:

No file format header found.

This is the case, even if I copy the packages.config file and rename it to bigpackages.config.

like image 874
David White Avatar asked Feb 23 '15 01:02

David White


2 Answers

It turns out that the name packages.config is expected, but any other config file name is rejected.

My solution was to put my bigpackages.config file in a subfolder, using the accepted filename. This command succeeds:

Nuget.exe restore [path]\big\packages.config -PackagesDirectory [path]\build\packages
like image 90
David White Avatar answered Sep 18 '22 16:09

David White


You should use NuGet v3 which appears to correctly handle such files.

It was NuGet 2.8 to introduce support for Individual packages.config Files for Different Platforms but even 2.8.6 correcltly handles them only within the solution restore procedure.

As I undestand all files with names other than exactly packages.config are treated as solution files. And the error is produced by the MSBuild run internally by the NuGet.

like image 20
Vertigo Avatar answered Sep 19 '22 16:09

Vertigo