Consume NuGet packages in Visual Studio
Support for NuGet packages is available with Package Management in VSTS and TFS 2017 and newer.
To consume NuGet packages from a feed, add the feed's NuGet endpoint as a package source in Visual Studio.
Package Management feeds work seamlessly with the NuGet Package Manager for Visual Studio 2015 extension as of Visual Studio 2015 Update 1. If you haven't installed Update 1 or later, you can update to the latest version of the NuGet Package Manager extension directly. Using Visual Studio for Mac? See this guidance.
Get your feed's NuGet package source URL
Navigate to your feed (or create a feed if you haven't). Then, select Connect to feed:
Next, copy the NuGet package source URL:
Windows: Add the feed to your NuGet configuration
- On the Tools menu, select Options....
- Expand NuGet Package Manager and select Package Sources.
- Click the green plus in the upper right corner.
- At the bottom of the dialog, enter the feed's name and the URL you got in the last step.
- Select Update.
- If you enabled the nuget.org upstream source, uncheck the nuget.org package source.
- Select OK.
Then click here to continue.
macOS: Add the feed to your NuGet configuration
- Get a Personal Access Token (PAT) and make a note of it.
- Open the Preferences dialog from the Visual Studio menu in the menu bar.
- Select NuGet -> Sources.
- Click Add then enter your feed's name, URL, any username, and your PAT as the password.
- Click OK, then OK again.
You can now discover and use packages in this feed. To add a package reference to a project:
- Find your project in Solution Explorer.
- Right-click References.
- Select Manage NuGet Packages....
- In the Package source dropdown, select your feed.
- Look for your package in the list.
Using Visual Studio 2015 or earlier?
You may need to download and install the latest NuGet Package Manager extension.
Using Visual Studio 2013 or earlier?
You'll need to get a Personal Access Token. When you're prompted for a username and password, use any username and your PAT as the password.
Use symbols to debug
Symbol servers enable debuggers to automatically retrieve the correct symbol files for packages without knowing product names, build numbers or package names. If symbols have been published for your packages, connect Visual Studio to the Symbol Server in Package Management to use symbols as you debug your packages.