Quickly add a reference to a NuGet packages in Visual Studio 2015

By | June 9, 2016

With the recent updates of Visual Studio 2015 (Update 3 RC),  we can now install and add references for Nuget Packages as part of quick fix light bulb.  Like wise, adding references from installed assemblies, Visual Studio now also suggests Nuget Packages for references for the specific types. Then you can install  and refer the latest version automatically or take help of package manager to install specific versions for the same Nuget Package.

Consider an example of using JSON.NET in your application, where either we do install the packages from Package Manager, Package Manager Console. Now, with the Visual Studio updates,  the yellow light blub also suggests for quick fix to add and install Newtonsoft.Json nuget package.

Quickly add a reference to a NuGet packages in Visual Studio 2015

You can select “Find and Install latest version” which will install the Nuget references in solution explorer, also refer the same in the file.

Quickly add a reference to a NuGet packages in Visual Studio 2015

 

In case you select “Install with Package Manager”, Visual Studio will open the Package Manager with Newtoksoft.Json as search item. Here you can select specific versions to install.

Quickly add a reference to a NuGet packages in Visual Studio 2015

 

Related Post : How to Install a local sources NuGet package or a Prerelease package in Visual Studio 2015 ?

 

You can enable this features from Tools –> Options dialog windows.

Navigate to C# Languages option and from Advanced Tab, select “Suggest usings for types in Nuget packages

Suggest usings for types in Nuget packages

Hope this helps !

4 thoughts on “Quickly add a reference to a NuGet packages in Visual Studio 2015

  1. Pingback: Dew Drop – June 9, 2016 (#2268) | Morning Dew

  2. Pingback: Visual Studio – Developer Top Ten for June 20th, 2016 - Dmitry Lyalin

  3. Pingback: Channel 9 To Live-Stream Visual Studio Live! | Codango.Com

Comments are closed.