Error "No file format header". NuGet Recovery Launch

When i started

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

works as expected. However team

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

error failed:

No file format header.

This is true even if I copy the package.config file and rename it to the bigpackages.config file.

+5
source share
3 answers

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

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

 Nuget.exe restore [path]\big\packages.config -PackagesDirectory [path]\build\packages 
+3
source

You should use NuGet v3, which seems to handle these files correctly.

It was NuGet 2.8 to implement support for individual package.config files for different platforms, but even 2.8.6 correctly processes them only as part of the solution to the recovery procedure.

Since I cannot find all files with names other than exactly packages.config , they are treated as decision files. And the error occurs when starting MSBuild inside NuGet.

+1
source

I had this problem while trying to create a Cloud Service / ccproj project. The problem was that I was transferring the project file for the solution file. By specifying the solution at the build stage and then specifying the project file in the MSBuild arguments, the problem disappeared:

- task: VSBuild@1 displayName: 'Build Worker Cloud Service - INT' inputs: solution: '**\SomeSolution.sln' (<-- SPECIFY SOLUTION HERE) msbuildArgs: '/t:Publish/t:restore/p:Project=SomeProject.ccproj(<-- SPECIFY PROJECT HERE)/p:SkipInvalidConfigurations=true/p:BclBuildImported=Ignore/p:OutputPath=bin\/p:PublishDir=$(build.artifactstagingdirectory)\appcloud\SomeFolderName.QA/p:TargetProfile=QA' platform: '$(BuildPlatform)' configuration: '$(BuildConfiguration_Release)' restoreNugetPackages: true

Note: YMMV for the parameters above - don't just copy and paste, as these are some of my surroundings. Please change if necessary. I set arrows to indicate what I changed to solve the problem.

0
source

Source: https://habr.com/ru/post/1213946/


All Articles