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

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

By default NuGet packages gets downloaded from the public feed of Nuget Package Source ( https://api.nuget.org/ ). However, there could  be some scenarios, where you want to use some of your company’s internal NuGet Packages or some prerelease version of package. If you search them  by just using adding nuget package, you won’t be able to get them. In these case, you need set up a custom NuGet source in Visual Studio.

Here is how you can create local Nuget source. First of all, Click on the “Manage Nuget Packages” from the Project Add Reference context menu.

Manage  Nuget Packges

By default, the  NuGet Package Manager window will refer to the all package source located at “Nuget.Org” as shown in image below.

 Nuget Packages Add

To Configure the local resource, click on the “Settings” icon.  This will bring the “Options” dialog windows.

Add New Source for Nuget Packages

Navigate to “Nuget Package Manager” –>  “Package Sources

There you will only find the default reference to the nuget.org.

Now, Click on the “Add” / + Icon. to add a new source and click on the Update and Ok.

Add New Source for Nuget Packages

Now, again go back to Nuget Package Manager and then select the “New Source” as a local source for your local nuget packages.

New NuGet Source

Incase, there is any “Pre release” version of packages you want to search, you can select the “Include prerelease” check box.

Here after, if you search, it will always search packages from your local Nuget Feeds.

If you are using “Package Manager Console” make sure you are also referring the the customize source for the package reference.

Package Manager Console -New Nuget Source

Hope this helps . Refer to this article for further information

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

3 Comments to “How to Install a local sources NuGet package or a Prerelease package in Visual Studio 2015 ?”

Comments are closed.