Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 916
mahesh peddi Avatar asked Jul 19 '16 14:07

mahesh peddi


People also ask

How do I manually install a NuGet package?

From Visual Studio, select Tools > NuGet Package Manager > Package Manager Console. After the Package Manager Console pane opens, verify that the Default project drop-down list shows the project in which you want to install the package. If you have a single project in the solution, it's preselected.

How do I download NuGet packages locally?

Open your file, and inside packageSources add a new local key following this structure <add key="local" value="path" /> . This path can be a relative or absolute from NuGet. config folder. Now you can install a package locally with dotnet add package and source option to local.

How do I download a NuGet package from the command line?

Download & Installation You can download the latest version from nuget.org/downloads. The latest version is always recommended, and 4.1. 0+ is required to publish packages to nuget.org. The file is not an installer, and it is the nuget.exe file directly.


1 Answers

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

like image 118
Weiwei Avatar answered Sep 20 '22 18:09

Weiwei