Introduction

NuGet is the most useful and essential tool for modern software development platforms via which developers can create, share and consume reusable code. Those useful or reusable common codes are compiled as DLLs and published as packages with code-related files and other information including the version number. Additionally, NuGet is a package manager for the software development platform that simplifies the process of adding and managing libraries and dependencies in your projects.

As a developer we all know that using available free, open source and paid packages is common in software development. So it is important for developer to know how use the packages in the solution. Most software uses free, open source and common packages however sometimes we need to use private and paid packages. So this articles provides you insight into how to configure and use private packages in your Dotnet project using Visual Studio 2022 with an example of Telerik private package. When we use private, paid and licensed packages that are needed in our project then, we need to configure it and install it. Setting and using private packages are different than the free online packages that we use in almost all projects.

Now let’s jump into the below steps to use private package.

Step 1– Open Visual Studio and then go to Tools-> NuGet Package Manager ->Setting and

then Go to NuGet Package Manager and then Package Sources as shown below. After that click on + green button. Provide the name for the package and set the feed URL to https://nuget.telerik.com/v3/index.json as illustrated below. Then click on OK.

Step 2 – Close Visual studio and then create project in .NET 7 or load your existing project in Visual studio 2022 where you need to install private package.

Step 3– Right click on the project and then go to Manage NuGet packages as shown below.

Step 4 – In the upper right corner of the NuGet Package Manager window, just select the Telerik package Source in the package sources dropdown option that we have just created in the Step 1.

Step 5 – Then you can choose Online or Browse the lists of packages.

Step 6 – Once you change the source for package to Telerik then you have to provide your credentials. Windows Authentication dialog box will appear where you need to provide your user and password.

Enter your credential and click on OK.

After that all the packages that are licensed to your account will be available in the Visual Studio NuGet Package manager.

You can then install if it is not already installed in your project. If your project already contains those packages and you just started working on the project containing private NuGet packages then first you just need to follow the above steps then all packages will start working without throwing any errors related with licenses in your local development environment.

Conclusion

Hence, in this article we have learned to use private NuGet packages. I hope you find it helpful to configure and use private packages in your .NET 7 project using Visual Studio 2022. Furthermore, similar way we can setup and use other private NuGet packages such as Grail and so on.