Just installed VS2017 Community edition -- I read some doc saying that NuGet is included -- but I don't see it and don't see how to add it. Should it appear basically as it did in VS2015?
You have to find it in the installer, second tab - "Packages", under the subheading "Code Tools"
You can launch the installer from the Tools menu in VS, it should be the first option.
I had the same issue. When I installed VS 2017, I only had Microsoft Visual Studio Offline Package. I can't remember how I figured it out, but I did. What you have to do is:
Open VS 2017.
Select Tools > NuGet Package Manager > Package Manager Settings.
In Options, select NuGet Package Manager > Package Sources.
Select + next to Available package sources.
Enter these values:
Name: nuget.org
Source: https://api.nuget.org/v3/index.json
Select OK.
Now, when you run Install Package commands, you'll get what you need.
NOTE: In the Package Manager Console, as your Package source, make sure you select All or nuget.org.
It was included as an option, NOT installed by default.
To install NuGet:
1. Tools > Get Tools and Features...
2. Single Component > Code Tools
3. √ NuGet package manager
4. update.
To find NuGet:
- Project > Manage NuGet packages...
- Tools > NuGet Package Manager
Project or Tools
In Visual Studio 2017,
Click on Tools -> Nuget Package Manager -> Package Manager Console :)
For anyone who stumbled across this question while trying to find out where nuget was installed to use it as a CLI, if you didn't install it individually you need to use it through MsBuild.exe's use of /t:restore to for example restore nuget packages. You'll have to install the individual component if you want the full tool and not just calls to a DLL via MSBuild.
Related
How can I install nuget packages for my PowerShell Projects in Visual Studio 2015? I have tried to do it with both the PowerShell Module Project and PowerShell Script Project. I have installed PowerShell Tools for Visual Studio 2015.
When I open these projects, the Default project in the Package Manager Console is empty. Here is a screenshot of what I mean.
When I try to install a nuget package, e.g. Pester, I get the following error.
I know this thread might be outdated and is rather old but my older article with some possible solutions might help here. I tested current state and still, no support inside VS 2015 for PowerShell project and NuGet packages together.
the current state is :
go with https://chocolatey.org/ and install it on your dev box (and CI) => you install pester globally with : choco install pester and update it if needed.
use old packages.config and update by hand version number and run nuget restore (nuget update will no longer work for this type of solution).
version whole pester into repo and call it directly. you can use nuget install pester for this (if you have nuget in path somewhere)
The link : http://rostacik.net/2015/12/16/how-to-use-nuget-packages-even-with-powershell-projects-with-visual-studio-2015/
I'm working with RESTful webservice, getting error while adding package "System.Net.Http";
"The 'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.5.0'. "
So, to resolve above error i'm trying to install "NuGet client" from "Add Package" option in xamarin studio, but this time I'm facing another issue that is;
"Could not install package 'NuGet.Client 3.2.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."
please help to resolve this issue.
Xamarin Studio currently does not support NuGet 3. It is currently only supported in Visual Studio 2015.
It is not possible to upgrade Xamarin Studio so it supports NuGet 3 at this time. Installing the NuGet.Client NuGet package does not upgrade NuGet in Xamarin Studio.
I would instead look at using the Microsoft.Net.Http NuGet package which you can install into a portable class library project (PCL) and supports all Xamarin Android and Xamarin iOS projects.
I was able to grab a copy of System.Net.Http.dll from another project and manually add it as a reference to my Xamarin project. I put it in the packages folder and then browsed to it from the edit references dialog.
For people facing problem trying to add System.Net.Http...
I was able to solve the problem by using Microsoft.Net.Http instead of System.Net.Http. In Xamarin studio, Right click on your project > Add > Add NuGet Packages.. > search for "Microsoft Http Client Libraries" and click Add Package.
There is a build server without Visual Studio, there are only build tools (MSBuild.exe, Nuget Manager,...). The Nuget Packet Manager need to upgraded to new version, but I cannot find any installer or way how to upgrade it without Visual Studio Gallery.
How shoudl I upgrade the Nuget Manager on build server?
The latest version of the nuget.exe command-line tool is always available from http://nuget.org/nuget.exe.
More details
I just inherited a large enterprise system that appears to use NuGet.
I have just read the basics on what NuGet is so pardon the simpleness of my questions.
Is there a way to tell NuGet to update and install all the packages needed to run the system? I am right now running and seeing what fails then guessing what NuGet packages are missing.
(No, there was no documentation in the enterprise system or many code comments, ugh)
From the package manager console try Update-Package –Project ProjectName
Visual Studio -> Tools -> Library Package Manager -> Package Manager Console
http://nuget.codeplex.com/wikipage?title=Updating%20All%20Packages
If the solution is configured to enable Nuget Package Restore you could also just delete the packages folder and rebuild all which would get everything that you needed. If you need to worry about javascript, configuration, etc... I would try the Update-Package route
Is there a way to download a previous version of a package with NuGet, not the latest one?
Bring up the Package Manager Console in Visual Studio - it's in Tools / NuGet Package Manager / Package Manager Console. Then run the Install-Package command:
Install-Package Common.Logging -Version 1.2.0
See the command reference for details.
Edit:
In order to list versions of a package you can use the Get-Package command with the remote argument and a filter:
Get-Package -ListAvailable -Filter Common.Logging -AllVersions
By pressing tab after the version option in the Install-Package command, you get a list of the latest available versions.
Browse to its page in the package index, eg. http://www.nuget.org/packages/Newtonsoft.Json/4.0.5
Then follow the install instructions given:
Install-Package Newtonsoft.Json -Version 4.0.5
Alternatively to download the .nupkg file, follow the 'Download' link eg. https://www.nuget.org/api/v2/package/Newtonsoft.Json/4.0.5
Obsolete: install my Chrome extension Nutake which inserts a download link.
Another option is to change the version number in the packages.config file. This will cause NuGet to download the dlls for that version the next time you build.
In NuGet 3.x (Visual Studio 2015) you can just select the version from the UI
In NuGet 3.0 the Get-Package command is deprecated and replaced with Find-Package command.
Find-Package Common.Logging -AllVersions
See the NuGet command reference docs for details.
This is the message shown if you try to use Get-Package in Visual Studio 2015.
This Command/Parameter combination has been deprecated and will be removed
in the next release. Please consider using the new command that replaces it:
'Find-Package [-Id] -AllVersions'
Or as #Yishai said, you can use the version number dropdown in the NuGet screen in Visual Studio.
As the original question does not state which NuGet frontend should be used, I would like to mention that NuGet 3.5 adds support for updating to a specific version via the command line client (which works for downgrades, too):
NuGet.exe update Common.Logging -Version 1.2.0
I landed on this page but my requirement is different, I wanted to download old version of .nupkg file instead of downloading from VS2019 - to get old version of .nupkg
Go to nuget.org
Search package ex: Newton Json
Click on result package name
Click on Versions tab and download the version you want
By using the Nuget Package Manager UI as mentioned above it helps to uninstall the nuget package first. I always have problems when going back on a nuget package version if I don't uninstall first. Some references are not cleaned properly. So I suggest the following workflow when installing an old nuget package through the Nuget Package Manager:
Selected your nuget server / source
Find and select the nuget package your want to install an older version
Uninstall current version
Click on the install drop-down > Select older version > Click Install
Good Luck :)