Search code examples
visual-studionuget

How to install Nuget Package without Visual Studio?


I've been trying to install Nuget Package, as I don't use Visual Studio for some reasons, I need to do it without Visual Studio.

Is there any way?

Please help me out.


Solution

  • After download the NuGet package, please unzip it to local folder, which will list all content of this package. Then add the dlls in the unzipped folder into your project through Add Reference.

    For example, I download EntityFramework package from nuget.org site. It will show as entityframework.6.1.3.nupkg. I unzip this .nupkg file to local folder and there has a lib folder in this unzipped folder. Then I find the EntityFramework.dll and EntityFramework.SqlServer.dll in that folder. I add these dlls as reference into my project.

    Another way install packages without Visual Studio is using nuget.exe. Please download it from https://dist.nuget.org/win-x86-commandline/latest/nuget.exe

    Then open command prompt windows to run nuget.exe and use the command line to install the packages that you want. The detailed command line for nuget, please refer to:

    https://docs.nuget.org/consume/command-line-reference