How to remove a Nuget package form solution - visual-studio

When I go on the "Manage Nuget packages for solution" in VS2015, I've a list of packages. Some of them are not used anymore, by any project(I don't see any checkbox on the right).
If I remove the corresponding nuget folder from the solution, it indicates me that I've some missing Nuget package on the next start.
On the right, the button to uninstall is grayed out.
How do I do to remove those package from the solution?
EDIT
Here is a screenshot showing my nuget pane:

One or more projects in your solution has that Nuget package installed. Right click on the project (not solution) and click "Manage Nuget Packages" from there you can uninstall the package. Note I click on the project and not solution:

First, open your Package Manager Console. Then select your project from the dropdown list. And run the following commands for uninstalling nuget packages.
Get-Package
for getting all the package you have installed.
and then
Uninstall-Package YourPackageName

Related

VS2013 - nuget.org gallery not showing

Trying to get the nugget.org gallery to show in VS2013 with no success.
Have installed the latest Nuget Package Manager extension is installed and ensure that the package source is pointing to nuget.org
I just can't seem to get the nuget.org gallery to appear. On either machines with VS2013 Update 4 installed.
Any idea or help to get this working.
The window in your screenshot is the Visual Studio Extension Manager. To access the Nuget repository you first need to create or open a project and then right-click the references item in the project (in the solution explorer). from the context menu you should find the option to "manage nuget packages for project". That will open the NuGet Repository screen.

Can NuGet update all projects when it gets a newer version for one project?

I have just added a package to a newer project, and its version has increased. Now I would like to have all the projects that use that package use the newer version. Is it possible for NuGet or a script to do this?
In solution node, select 'Manage NuGet Packages for Solutions' in context menu.
For each package, click 'Manage' button and choose project to use this package.
Then update package in 'Manage NuGet Packages for Solutions' window, packages are updated for all projects.

Trouble removing package from Visual Studio 2010

I accidently added a package to my VS2010 MVC 3 project via the 'Manage NuGet Packages' tool in the 'Tools' menu and I would like to remove it, however after some research I can't seem to figure out how to do it.
I have tried opening up the 'Manage NuGet Packages' tool within the solution, but there seems to be no uninstall option so I searched online and found the following article on installing and uninstalling packages. It mentions right clicking on the project and choosing the 'Add Package Library Reference' option, but this doesn't exist. I did notice that the example's project is a Website type, where mine isn't as I am using a modified version of the MVC project template.
Anyway, I searched online again and found several mentions of starting VS2010 as an Administrator and then the option for uninstalling should be available in the 'Manage NuGet Packages' tool, however this didn't change anything and no uninstall option appears.
Can anyone suggest what might be the problem and how to remove this package?
Here's a link to the docs:
Go to the section entitled Removing a Package, you can use the console to uninstall the package you want.
From the Library Package Manager, click the Installed Packages tab, then click Manage on the package you want to remove. Clear the checkbox for the solution/project you want the package uninstalled from, then click OK.
Or, open up the Package Manager Console and type "uninstall-package YourPackageName".

Nuget - Don't see allow nuget to download missing packages during build

I get a message saying the following:
Error 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'.
When I go to Tools -> Options, I do not see Package Manager and underneath I see Package Sources and Recent Packages. I do not see anywhere where I can set Allow Nuget to download missing packages during build though.
The option to give consent in the UI has been added with NuGet Package Manager 1.8. It's the 3rd item under Tools-> Options-> Package Manager-> General : "Package Restore : Allow NuGet to download missing packages during build".
Please make sure NuGet is up-to-date in Tools->Extension Manager.
Alternatively you can give consent by setting the EnableNuGetPackageRestore Environment variable to true.
I found I needed an extra couple of steps to get it to download the packages
Check Allow NuGet to download missing packages during build
Check Always show solution in Projects and Solutions
Right click on solution and Enable NuGet Package Restore
Open Manage NuGet Packages and click Restore
I did not seem to have the "Package Manager" node under Tools->Options [this was in Visual Studio 2013 :-)]. To get that node in there, I browsed to Tools -> Extensions and Updates and searched for nuget. Installing "NuGet for Visual Studio 2013" got me the node and the option to allow package restore!
I am using Visual Studio 2010 and NuGet 2.0.
Someone had checked in a solution that used NuGet for various packages. When I checked out the solution and built it, I got the same errors. What's more, when I viewed the NuGet Package Manager from the Tools -> Options window, the Package Restore already had the appropriate check boxes checked.
I tried clicking the Clear Package Cache button. After doing that, everything built correctly.

JSON.NET How To Reference?

I just installed the Json.Net package and now I am wondering how I can import this to my project? I first tried "using Newtonsoft.Json;" but that's not coming up. I tried looking for it by adding a reference to my project first but I can't find it the list either? I also can't seem to find anyone else with this problem or any directions doing a few quick Google searches. Please tell me how easy this is to do...
right click on your project and select "manage nuget package". put json into the search, find it in the list and click "install"
If you are doing this manually, right click on the "Reference" folder in your project's solution tree. Choose "Add Reference" -> "Browse" tab, locate Newtonsoft.Json.dll on your computer(You have to download this from the internet first) and add it as a reference to your project.
If you are using NuGet, right click on the "Reference" folder in your project's solution tree and choose "Manage NuGet Packages", pick the "Online" tab, search for Json.Net and click "install".
Right click on your project in solution explorer and select "manage nuget packages", then click Online in the navigation bar, type newtonsoft into the search bar, find it in the list and click "install"
Check to see if the Json.net is already install in your project.
If it is already installed go and remove the "package" entry from "packages.config" file. Now go to NuGet "Package Manager Console" and install the new package using the following command:
PM> Install-Package Newtonsoft.Json {Your Project Name} 6.0.3 nuget.org
If it is not installed, go to NuGet and search for JSon.Net and select the project and click install.

Resources