Skip to main content
NuGet packages

Adding references using NuGet packages in Visual Studio

Hello Readers,

With the help of this post, we will be learning about adding references to projects using NuGet packages in Visual Studio.

NuGet is a free and open-source package manager, inspired from the most efficient features available in the Linux EMACS software, designed for the Microsoft development platform (formerly known as NuPack).

Since its introduction in 2010, NuGet has evolved into a larger ecosystem of tools and services.

How to add references using in Visual Studio using NuGet? #visualstudio #nuget Click To Tweet

Benefits of using NuGet

  1. NuGet is smart enough to add assembly binding redirects when required
  2. Dependencies of a package are automatically resolved
  3. It notifies you about available package updates
  4. Creating packages makes people think about component architecture (all dependencies should be packaged as well)
  5. You can get rid of binaries bloating your VCS repositories (package restore feature)

I am sure there are many more advantages of using NuGet packages. If you think of any other apart from those listed above, feel free to list them in comments section right below the post.

Steps for adding DLLs or assemblies in project using NuGet:

Step 1 – Go to Projects Menu and Select Manage NuGet Packages as shown below:

Adding references using NuGet packages

Step 2 – Search for the reference or DLL which you want to add by typing into search box. Once you find appropriate reference to add, click on Install button.

Adding references using NuGet packages

Step 3 – After the installation, you will be able to see that visual studio have added a folder named “.nuget” in your solution explorer.

Adding references using NuGet packages

Step 4 – For adding references, Navigate to Packages folder in your solution and choose the appropriate DLL.

Adding references using NuGet packages

This is all about adding references using NuGet in Visual Studio. Feel free to comment, if you face any issues.

Hope you enjoyed this post.

References

What do you think?

Dear Readers,
Your questions or suggestions are always welcome. Feel free to email us or put your thoughts as comments below. In addition to that, if you found this post useful then please share along with your friends and help them to learn.

Keep Learning!

Dipendra Shekhawat

Hey Reader! I am a full time software developer and part time blogger from Pune, India. I write about technologies like WordPress, ASP.NET, C#, JQuery, HTML, CSS, AJAX, WCF, Web Services. For more you can refer to my blog – http://dipendrashekhawat.com