In my day-to-day job we have a lot of projects that need to pull in the same internal libraries over and over again.
So we decided to create NuGet-Packages for these libraries and create a local feed, from which we can pull in the NuGet-Packages from our different projects.
These are the steps to create your own NuGet-Packages and use your own local feed.
.nuspec file is the NuGet-Packages manifest and defines the different values of the package. Like the name, description, version, etc..
You can run the following command in a developer command line to create the manifest file.
You can execute the following command in a developer command line to actually create the package, based on the previously created manifest.
To add the created NuGet-Package to a local feed you can execute the following command in a developer command line.
nuget add MyPackage.1.0.0.nupkg --source \\my_server\my_local_feed_share
To actually find the NuGet-Packages from the local feed, you need to add it to the package sources.
In Visual Studio navigate to
Tools > Options > Nuget Package Manager > Package Sources and click on the green
+ icon to add a new source. Provide a
name and a
source for your local feed.
After that you are able to browse your local feed when managing NuGet-Packages for a project.