NuGet Package restore failed for project Miscellaneous Files: Value cannot be null or an empty string. Parameter name: root. 0 0

Visual Studio-2012NugetNuget Package-Restore

Visual Studio-2012 Problem Overview


I have such error in vs 2012: NuGet Package restore failed for project Miscellaneous Files: Value cannot be null or an empty string. Parameter name: root. 0 0

I see that it's a bug https://nuget.codeplex.com/workitem/3780 that was fixed for version 2.8 But I can't find the 2.8 version on https://nuget.codeplex.com Is it possible to fix the error without the installation of the 2.8 version? Or how to get the 2.8?

Visual Studio-2012 Solutions


Solution 1 - Visual Studio-2012

I fixed this by deleting the visual studio solution user options file (.suo) and then restarting VS.

UPDATE: For VS 2017, you need to delete a hidden folder named .vs located in solution directory (Thanks @Tien Dinh!)

Solution 2 - Visual Studio-2012

Had the same issue with VS2013 today. After running an update on installed packages (tools -> extensions and updates) (which included nuget), and installing some updates for VS2013 (windows update had some), it has gone away.

So basically, check for those updates, update, and it might solve the issue.

Solution 3 - Visual Studio-2012

I have VS 2013. According to the extensions manager, nuget was up to date.

Ran a manual install from the vsix site: http://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca

... fixed the issue.

Solution 4 - Visual Studio-2012

A simple restart of Visual Studio should clear everything up. I had the same issue in VS2013 after upgrading Web API. It was not necessary to delete the .suo.

Solution 5 - Visual Studio-2012

I right clicked the solution and chose "Enable Nuget Package Restore". This fixed the problem.

This link from MSDN shows how:

http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx

[tag:nuget] [tag:visual-studio]

Solution 6 - Visual Studio-2012

I fixed this by enabling auto restore on nuget packages in the solution

Solution 7 - Visual Studio-2012

Not an exact answer, but best I can tell, NuGet ver. 2.8 is not available yet. I have been dealing with the same issue for sometime now (2 months). I was still able to build my solution successfully even with that error by performing the build against the main project. I am really hoping to get this issue resolved because it is a serious eyesore while working.

Solution 8 - Visual Studio-2012

You can get a non-release version of NuGet 2.8 http://build.nuget.org/NuGet.Tools.vsix">here</a>;. Instructions are here: http://docs.nuget.org/docs/start-here/installing-nuget#Installing_a_CI_build">Installing a CI build. This fix the issue for me on VS2010.

Solution 9 - Visual Studio-2012

I fixed this issue after clicking the "Clear All Nuget Cache(s)"

Nuget Tools -> Clear All Cache

Solution 10 - Visual Studio-2012

Just as a brief note. I got this error by running the project on a mapped network drive i.e. T:\NetworkFolder\Project\Solution.sln.

Obviously the solution is simple - don't do this - copy it onto your machine. Might save someone some pain at some point.

Solution 11 - Visual Studio-2012

None of the above answers helped for me, and it was getting pretty frustrating.

What worked for me (with Visual Studio Professional 2017, version 15.8.5) was doing the following steps;

  1. Tools > Options > NuGet Package Manager > Click 'Clear All NuGet Cache(s)'

Hope this helps someone!

Solution 12 - Visual Studio-2012

It did not work for me. I had to go to tools, extension manager... Uninstall NuGet Restart Visual Studio 2010 Download NuGet Reinstall it. Restart Visual Studio. Fixed it all!

Solution 13 - Visual Studio-2012

Let's check the name of packages in file packages.config. Sometime the name incorrect it occurr

Solution 14 - Visual Studio-2012

I got this error by accidentally renaming one of the namespace id attributes inside packages.config file to something else. I was able to track this down by comparing checked in version of packages.config, with my local one. After I corrected the problem, all I had to do is close the packages.config file, rebuild, and the problem was gone.

Solution 15 - Visual Studio-2012

In Visual Studio 2015:

Go to Options->NuGet Package Manager-> Package Sources, make sure "Microsoft and .Net" is checked in the Machine-wide package list.

Solution 16 - Visual Studio-2012

I uninstalled and reinstalled nUnit 3.7.1 and everything started working again. I have a few nuget packages, but nunit 3.7.1 is the only one I reinstalled, I left the rest alone.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMidnight GuestView Question on Stackoverflow
Solution 1 - Visual Studio-2012st78View Answer on Stackoverflow
Solution 2 - Visual Studio-2012NoctisView Answer on Stackoverflow
Solution 3 - Visual Studio-2012InquisitorJaxView Answer on Stackoverflow
Solution 4 - Visual Studio-2012EricView Answer on Stackoverflow
Solution 5 - Visual Studio-2012ToFoView Answer on Stackoverflow
Solution 6 - Visual Studio-2012Smitha PoluriView Answer on Stackoverflow
Solution 7 - Visual Studio-2012user2476190View Answer on Stackoverflow
Solution 8 - Visual Studio-2012Dan CooperView Answer on Stackoverflow
Solution 9 - Visual Studio-2012Glenox AndalView Answer on Stackoverflow
Solution 10 - Visual Studio-2012Crab BucketView Answer on Stackoverflow
Solution 11 - Visual Studio-2012IfElseTryCatchView Answer on Stackoverflow
Solution 12 - Visual Studio-2012user2343577View Answer on Stackoverflow
Solution 13 - Visual Studio-2012Tailmse02457View Answer on Stackoverflow
Solution 14 - Visual Studio-2012Eternal21View Answer on Stackoverflow
Solution 15 - Visual Studio-2012David JView Answer on Stackoverflow
Solution 16 - Visual Studio-2012BClaydonView Answer on Stackoverflow