At my company we have a NuGet package that, when applied on a blank Visual Studio solution, will generate a solution template with a predefined set of properly named and configured projects. We install the package by just executing the regular Install-package
command in the package manager console.
However this seems to have been stopped working in Visual Studio 2015. If I try to install the package I get this error:
install-package : Project 'Default' is not found.
At line:1 char:1
+ install-package (The package name)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Default:String) [Install-Package], ItemNotFoundException
+ FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
What puzzles me is that this was working fine in Visual Studio 2013. I have been looking for information about this behavior but I haven't seen it mentioned nor reported as a bug anywhere.
Does anyone know what is happening here? Is it a bug? Is it a change in the way NuGet works in VS 2015?
By the way, if it matters, the VS 2013 edition I am using is Professional, while the VS 2015 edition is Community.
To install it individually in Visual Studio Installer, select the Individual components tab, and then select NuGet package manager under Code tools . For Visual Studio 2015, if you're missing the NuGet Package Manager, check Tools > Extensions and Updates and search for the NuGet Package Manager extension.
Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.
The Add NuGet packages menu will be disabled if a project is not selected in the Solution window. Which is my guess as to why it is disabled for you. Update and Restore NuGet packages is available if a solution or project is selected.
In Tools -> Options -> NuGet Package Manager -> General you need to select the "Allow NuGet to download missing packages" option which allows NuGet to restore and the "Automatically check for missing packages during build in Visual Studio" which enables on build restore.
It seems that solution level packages are deprecated in Visual Studio 2015, so no real solution for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With