Creating a local NuGet repository and consuming packages from it
In this recipe, we will learn how to consume packages from a local repository. We will also learn how to create a local repository.
How to do it...
- After having created a folder locally on our own computer, we will use it to be the local repository for our packages. In this case, this folder will be
C:\dev\NuGetPkg
:

- Let's configure Visual Studio to configure this new repository. Navigate to
Tools | NuGet Package Manager | Package Manager Settings | Package Sources
:

- Let's click on the
+
button to add a new repository:

- Let's add a name to this repository:

- Select a local folder:

- Let's click on the
Update
button to update the directory address:

- Let's place the NuGet package we just created in the previous recipe:

- Right-click on the root project in
Solution Explorer
and selectManage NuGet Packages
to open theNuGet Package Manager
. - If we open the Package source drop-down list in the top-right corner, we can see our new package repository...