Publish Nuget Packages to a local folder and consume in Visual Studio
Nuget is the package manager for .Net. Consuming nuget packages from Nuget Gallery is just away from few clicks or one line in command prompt. Authors publish their packages to public Nuget Gallery. But when we have have the code that can not be shared publicly, we need to go for paid solutions or set up own private nuget repository or set up private nuget server with some of the opensource tools.
Another alternative for small teams or individual developers is setting up private repository for free in a local or network file share.
Publishing and cosuming of nuget to a local folder or network file share can be achieved by
Download the latest version of nuget.exe from nuget.org. Move it any location of your choice.Then add the folder where nuget.exe is placed to your PATH variable.
If Windows 10, search for Edit Environment variables for you account in start menu and go to environment variables. Select Path and click edit to append new Path.
Publishing and cosuming of nuget to a local folder or network file share can be achieved by
- Installing Nuget Command line on the package development machine
- Pack and push package to folder or network share
- Add folder or network share as Package source in Visual Studio
Intalling Nuget Command line client
Download the latest version of nuget.exe from nuget.org. Move it any location of your choice.Then add the folder where nuget.exe is placed to your PATH variable.
If Windows 10, search for Edit Environment variables for you account in start menu and go to environment variables. Select Path and click edit to append new Path.
![]() |
Enviornment Varibles in Win 10 |
to be contd..