Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Commented Issue: nuget and VS2012 broken by package restore [2914]

$
0
0
This started happening today, and only to me after I installed Nuget 2.2. I have removed it and downgraded to nuget 2.1 but the behaviour is unchanged.

Similar issues happen on all other Solutions that I have tried. I could build everything yesterday, I can build nothing today. Visual Studio is completely broken.

To reproduce the issue I do this:

Open Visual Studio 2012
File| New project|ASP.Net 4 Web Application
Rebuild solution and it works.
Enable Nuget package restore
Rebuild and it fails with output:


1>------ Rebuild All started: Project: PT, Configuration: Debug Any CPU ------
1>C:\code\temp\PackageTest\.nuget\nuget.targets(90,9): error : The system cannot find the path specified.
1> All packages listed in packages.config are already installed.
1>C:\code\temp\PackageTest\.nuget\nuget.targets(90,9): error MSB3073: The command ""C:\code\temp\PackageTest\.nuget\nuget.exe" install "C:\code\temp\PackageTest\PT\packages.config" -source "" -RequireConsent -o "C:\code\temp\PackageTest\packages"" exited with code -1.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I have verified that those paths do exist.


If I open a cmd window and enter:
cd C:\code\temp\PackageTest
"C:\code\temp\PackageTest\.nuget\nuget.exe" install "C:\code\temp\PackageTest\PT\packages.config" -source "" -RequireConsent -o "C:\code\temp\PackageTest\packages"
I get result "All packages listed in packages.config are already installed." and no error.

But if I use a "Developer command prompt for Visual studio 2012" and run "msbuild CP.sln" it fails as in Visual Studio.

On my colleague's machine (he has not installed nuget 2.2) this all works and the issues cannot be reproduced.

After closing and re-opening the project, none of the project references work, i.e. they all give warnings like "Warning 13 The referenced component 'System.Xml.Linq' could not be found". And under project References, every single one has the yellow triangle.

Visual studio is running as administrator. And the Options setting to "Allow NuGet to download missing packages during build" is checked.

It's not just web projects, I get the same behaviour when I create a console app. The difference is that for a console app, it only starts failing after I add a nuget package reference (any package) since the project doesn't have a packages.config until then.

It's definitely a nuget package restore issue - if I edit the .csproj file and remove the line " <Import Project="$(SolutionDir)\.nuget\nuget.targets" />" then I can build.
Comments: Hi guys, I have the exactly same problem as described above. Any help would be highly appreciated. I have NuGet Version 2.2.40116.9051 installed. Thanks, Alex

Viewing all articles
Browse latest Browse all 7612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>