Adding A Sitecore NuGet Repository To Visual Studio

April 24, 2022

Adding A Sitecore NuGet Package In Visual Studio

In this blog, I will explain how can to add a Sitecore NuGet Package source to reference dependencies for a solution in Visual Studio.

What Is NuGet?

NuGet is the package manager for .NET. The NuGet client tools provide the ability to produce and consume packages.

The NuGet Gallery is the central package repository used by all package authors and consumers.

We can easily update any DLL (Dynamic Link Library) at any time and also remove the dependency of keeping these files locally.

How To Add A Sitecore NuGet Reference To Your Project

Step 1

In Visual Studio, go to project Right-Click and choose Manage NuGet Package. It will open a new window.

In Visual Studio Code right-click your project and select Manage NuGet Package

Step 2

Click on the Settings menu in the top right corner. It will open a new popup.

Click the Settings button in Manage NuGet Package in Visual Studio Code.

Note: By default, NuGet package manager connects with NuGet.org. We can't add Sitecore Assemblies from NuGet.org. So, we would need to add another source to the package source.

Step 3

Go into Package Source and click add button +.

In Package Sources click the plus icon to add a new package source

Step 4

Add a Name for your package. Add this URL as the Source and click OK.

For the Source URL, you can open this URL and copy the URL according to the visual studio version.

Add a package name and source, click ok to continue.

Step 5

Now, reopen the manage NuGet package manager and search Sitecore for the references that you want to install according to your Sitecore version.

Reopen NuGet Package manager and search Sitecore references you want to install.

Sitecore solutions banner for Fishtank services