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

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?

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!)

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.

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.

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.

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
nuget visual-studio

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

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.

You can get a non-release version of NuGet 2.8 here. Instructions are here: Installing a CI build. This fix the issue for me on VS2010.

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

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.

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!

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!

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

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.

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.

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.

Related

References and .dll missing from TFS get latest

I'm having an issue related to team foundation server with Visual Studio 2012.
I've checked in a new solution to the server, however when i get latest version for other machines, most of the references are missing and the .dll files in the bin cannot be located.
Is this because the files are not being pushed when i check in.
Any help is appreciated thanks
In Solution Explorer, right click the DLLs that aren't being included, go to Properties, and be sure that the Build Action is set to "Content".
Check whether you are using MSBuild-Integrated solutions or using Automatic Package Restore. If you use MSBuild-Integrated solutions, migrating MSBuild-Integrated solutions to use Automatic Package Restore.
If you haven't used Nuget to restore package. Check: https://docs.nuget.org/consume/package-restore
Check whether your project link to other projects. Don't reference output assemblies. Make a project reference or create a NuGet package.

All MSTest Tests being ignored

I have a visual studio 2013 with resharper 8.1 installed.
Out of nowhere all the unittests started being ignored, with no stack message at all.
I´ve already, restarted VS, PC, and even uninstalled resharper.
Any thoughts?
Is there any log file available that could, at least, give me an extra hint?
TKS
The problem turned out to be a duplicated file in a deployment folder. Don´t know how windows let 2 files with the same name at the same folder, but they were there.
My problem with the same symptoms has been solved by updating NUnit project dependency NuGet package up to last stable version. (May be just reinstalling could solve the problem)
Had similar issue. Was caused by multiple MSTest versions in the same solution.

The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly

After installing Slow Cheeath (v. 2.5.10.3) to two projects in my solution, I am receiving the following error:
"The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users
\User\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll. Could
not load file or assembly 'file:///C:\Users\User\AppData\Local\Microsoft\MSBuild
\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll' or one of its dependencies. The system cannot
find the file specified. Confirm that the <UsingTask> declaration is correct, that the
assembly and all its dependencies are available, and that the task contains a public
class that implements Microsoft.Build.Framework.ITask. ISA.IMPD.FalseAlarm.Web.Portal"
I have removed both projects in their entirety (along with Slow Cheetah), re-installed both projects (along with Slow Cheetah), and Rebuilt the solution to no avail. Can anyone help with this type of error?
In my case the error occured while compiling a web project. The folder
%userprofile%\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2
was empty. All the SlowCheetah components were in SlowCheetah\v1 folder instead. I've copied all files from V1 folder to v2.5.10.2 and everything compiled and transformed fine. To make non web projects compile, I also had to delete V1 folder as suggested by Whoever in this thread.
This was a brand new installation of the SlowCheetah Extension and I did not expect the v1 folder to exist at all. I believe this was a bug in the extension installation for Visual Studio 2012.
delete
AppData\Local\Microsoft\MSBuild\SlowCheetah\v1
I seem to have found to solution to this problem.
Here's what I did:
You need to close Visual Studio, then navigate to:
C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions
Delete the cache file that has the latest date and time
Open Visual Studio and remove Slow Cheetah from the Solution level
Re-install Slow Cheetah from the solution level to the desired projects.
This was failing on our build server, so I changed the revision number from:
<sc-MSBuildLibPathLocal Condition=" '$(sc-MSBuildLibPathLocal)'=='' ">$(LocalAppData)\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\</sc-MSBuildLibPathLocal>
To:
<sc-MSBuildLibPathLocal Condition=" '$(sc-MSBuildLibPathLocal)'=='' ">$(LocalAppData)\Microsoft\MSBuild\SlowCheetah\v2.5.10.3\</sc-MSBuildLibPathLocal>
Why it was pointed to v2.5.10.2 is a mystery, but I'm definitely using v2.5.10.3! Looks like the nuget package itself has the bug in it.
I resolved it like this:
Uninstall slowcheetah => Tools>Extensions and Updates
click OK when VS asks you to restart VS.
in "C:\Users\AppData\Local\Microsoft\MSBuild\SlowCheetah" remove the 'v1' folder (which windows automatically creates when restarting your VS) (here be dragons..)
reïnstall slowcheetah (see step 1) => a new folder v2.5.10.2 will be created.
Again, click OK when he asks to restart
Build your solution
Regards,
Peter
This problem went away for me after using the preview transformation feature in the context menu. Originally suggested here.
FYI this was on VS 2010 Premium.
Having multiple versions can lead to conflicts.
In my case I have installed both Microsoft.VisualStudio.SlowCheetah by Microsoft and SlowCheetah by Sayed Ibrahim Hashimi. After uninstalling the package from Microsoft everything went well.
I have deleted the old files in C:\Users\\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1. I also needed to upgrade Visual Studio 2012 to update 4 to make it work.
I was able to fix this issue by doing the following:
Uninstalling the SlowCheetah extension from the TOOLS > Extensions and Updates... menu
Closing Visual Studio
Deleting all files in the "C:\Users\username\AppData\Local\Microsoft\VisualStudio\11.0\Extensions" folder
Opening Visual Studio
Reinstalling SlowCheetah from the TOOLS > Extensions and Updates... menu (which requires a Visual Studio restart)
This is using Visual Studio 2012 Premium with Update 4 and SlowCheetah version 2.5.10.
If you're getting this error on a TFS Build Server (in my case TFS Express 2013) then you will need to copy over the files from your local machine
C:\Users\SWEAVER\AppData\local\Microsoft\MSBuild\SlowCheetah
on your machine to whichever user your TFS build is running under
C:\users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah
Please note AppData is a hidden directory that you may not see, but just type the name and hit enter and it will come up.
I'm using VS2013 so I didn't copy v1 (I think v1 is for VS2012).
The original TFS error I got was :
C:\Builds\1\www.XXXXX.com\RRStore - XXXXX
Silverlight\Sources\RRStore.AdminConsole\Properties\SlowCheetah\SlowCheetah.Transforms.targets
(150): The "SlowCheetah.Xdt.TransformXml" task could not be loaded
from the assembly
C:\Users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll.
Could not load file or assembly
'file:///C:\Users\TFSBuild\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.2\SlowCheetah.Xdt.dll'
or one of its dependencies. The system cannot find the file specified.
Confirm that the declaration is correct, that the assembly
and all its dependencies are available, and that the task contains a
public class that implements Microsoft.Build.Framework.ITask.
Fortunately this error told me exactly where to place the files.
I had the same problem in Visual Studio 2013. Just install SlowCheetah NuGet package:
https://www.nuget.org/packages/SlowCheetah
They've released a new version which brings the installation procedure up to date:
https://blogs.msdn.microsoft.com/visualstudio/2017/05/25/whats-new-and-improved-with-the-slowcheetah-extension/
Tired of having to install your NuGet packages manually to get
SlowCheetah to work? We’ve added automatic NuGet installation to help
streamline your process. All you need to install is the latest
extension and SlowCheetah will take care of the rest. When you use
SlowCheetah for the first time in a project, it will prompt you to
install or update NuGet packages. Agree and you’re ready to go!
Close Visual Studio
Install the VISX extension
Open your project.
This version detects if you already have it installed and offers to upgrade.
I would recommend checking in to source control and then doing a compare of your .csproj file to see what changes it made.

Is MvcScaffolding compatible with VS 2013 RC by command line?

At NuGet when I try to install MvcScaffolding, by typing:
Install-Package MvcScaffolding
I am getting this error
Set-DefaultScaffolder : Cannot get an instance of EnvDTE.DTE
Is it happening because of this new scaffolding engine in Visual Studio 2013 ?
I emailed Scott Hanselman about this a few weeks back. Here's his response:
We've found out what's up and we are going to release a fixed version, although we're taking Scaffolding in a new direction with VS2013 we still want this to work. Thanks for finding this bug.
So I'd keep eyes peeled for a new release of MvcScaffold that will hopefully resolve this. In the mean time, there are new features for VS2013 that take scaffolding in a much-improved direction, so you may want to investigate those.
Edit: There's a new package available (make sure to run VS2013 as admin to get it to work):
Install-Package MvcScaffolding -Version 1.0.8-vs2013 -Pre
I came across this same bug in VS2015. I pulled the source, fixed the bugs, and uploaded new NuGet packages with linked dependencies. The 3 new packages are:
MvcScaffolding.VS2015
T4Scaffolding.VS2015
T4Scaffolding.Core.VS2015
If you simply install the MvcScaffolding package, the other packages will be pulled through. Hope this helps someone else.
Cheers.
I found that I had to go into my .\packages folder (for the solution) and manually delete all MvcScaffolding and T4Scaffolding package folders (I have the NuGet "restore packages" feature enabled that, I thought, would take care to restore anything that I should not have deleted, plus I made a backup).
After that, antinescience's Install-Package command for vs2013 worked fine, and so did the "Scaffold Controller ..." to scaffold an MVC5 controller.
Just a quick update, back on time when I wrote this question Visual Studio 2013 was still in Release Candidate. Now, 8 months later, Microsoft has just released Visual Studio 2013 Update 2 and since then everything is working well with MVCScaffolding.
I've test it in Windows 8 and 7. In Windows 7 it was necessary to install
Windows Management Framework 4.0 before.

VS 2012 project references all missing-- troubleshooting techniques?

I've downloaded a straightforward VS 2012 solution and for some reason am having trouble with the references in it-- they're all marked with yellow exclamation points, even core .Net libraries.
This isn't a problem in any of my other VS 2012 projects. I've scrubbed and redownloaded the solution several times, each with the same result.
I'm using VS 2012 Professional, update 3, and I have the .Net 4.5 runtime installed. So I think I'm caught up on the latest platform and tools.
I updated all the NuGet packages in the solution but that didn't help. Would anyone know what I can look at to see where the problem is? (I downloaded this same solution on another box and have no problems whatsoever. Both machines are running Windows 7.)
Popped open the Solution and got the following errors:
Warning 2 The command ""C:\****************\Downloads\PluralsightSpaJumpStartFinal-master\PluralsightSpaJumpStartFinal-master\.nuget\nuget.exe" install "C:\*************\PluralsightSpaJumpStartFinal-master\PluralsightSpaJumpStartFinal-master\SPAJumpStart\packages.config" -source "" -RequireConsent -o "C:***************\PluralsightSpaJumpStartFinal-master\PluralsightSpaJumpStartFinal-master\packages"" exited with code 1. SPAJumpStart
Warning 1 Package restore is disabled by default. To give consent, open the Visual Studio Options dialog, click on Package Manager node and check 'Allow NuGet to download missing packages during build.' You can also give consent by setting the environment variable 'EnableNuGetPackageRestore' to 'true'. SPAJumpStart
Looks like the references are tied into a custom nuget package, including the normal .net 4.5 references. Enabling the 'EnableNuGetPackageRestore' option should fix the issue.

Resources