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.
Step 2
Click on the Settings menu in the top right corner. It will open a new popup.
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 +.
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.
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.