Nuget v 2.1.31002.9028 Package Restore fails

Topics: General
Oct 11, 2012 at 5:17 AM

I noticed my automated builds began to fail recently, even though they build with no problem in VS2012

I did some investigation and nuget is throwing an error during package restore which halts the compilation.  I thought it was something wrong with my project and spent hours trying to backtrack to see where I went wrong until I finally decided to create a new project from scratch and the problem happens even then.

I downgraded my .nuget folder to an version  2.0.30828.5 of nuget.exe and nuget.targets and everything began to work again as it did before.  

 


Microsoft (R) Build Engine version 4.0.30319.17929[Microsoft .NET Framework, version 4.0.30319.17929]Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/11/2012 1:11:54 AM.Project "C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\TestNugetRestore.csproj" on node 1 (default targets).RestorePackages:  "..\.nuget\nuget.exe" install "C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\packages.config" -source ""  -RequireConsent -solutionDir "..\ "C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\.nuget\nuget.targets(87,9): error : The path is not of a legal form. [C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\TestNugetRestore.csproj]C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\.nuget\nuget.targets(87,9): error MSB3073: The command ""..\.nuget\nuget.exe" install "C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\packages.config" -source ""  -RequireConsent -solutionDir "..\ "" exited with code 1. [C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\TestNugetRestore.csproj]Done Building Project "C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\TestNugetRestore.csproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\TestNugetRestore.csproj" (default target) (1) ->(RestorePackages target) ->   C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\.nuget\nuget.targets(87,9): error : The path is not of a legal form. [C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\TestNugetRestore.csproj]  C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\.nuget\nuget.targets(87,9): error MSB3073: The command ""..\.nuget\nuget.exe" install "C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\packages.config" -source ""  -RequireConsent -solutionDir "..\ "" exited with code 1. [C:\Users\Bryan\Documents\Visual Studio 2012\Projects\TestNugetRestore\TestNugetRestore\TestNugetRestore.csproj]
    0 Warning(s)    2 Error(s)
Time Elapsed 00:00:00.49

 


 

 

 

Oct 11, 2012 at 7:41 PM

I'm experiencing the same problem with NuGet 2.1

C:\a\src\.nuget\nuget.targets (87): The path is not of a legal form.

Downgraded to 1.8 and builds are now running fine

Oct 12, 2012 at 5:10 PM
Edited Oct 12, 2012 at 6:00 PM

I have the same issue with this build using VS2010.

In my case resolved the issue by replacing 

-solutionDir "$(SolutionDir) " with

-OutputDirectory "$(SolutionDir)packages\\"

in NuGet.targets

Oct 12, 2012 at 9:50 PM

[+1]
same issue

Oct 16, 2012 at 12:16 AM

FYI:  Just got word that they are working on a fix:

https://twitter.com/davidfowl/status/257993464338341889

Oct 19, 2012 at 4:52 AM

An update to Nuget.CommandLine package, version 2.1.1, to address this issue was released. Please update your nuget.exe and verify that it fixes your problem. Thanks for your patience.

Dec 13, 2012 at 8:58 PM
Edited Dec 13, 2012 at 9:17 PM

I'm running version NuGet 2.2.31210.9045 and Nuget.CommandLine 2.2.0 I still have this problem when using continuous integration.

The imported project "C:\a\src\.nuget\nuget.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.