简体   繁体   English

如何在没有Visual Studio的情况下安装Nuget包?

[英]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. 我一直在尝试安装Nuget Package,因为我出于某些原因不使用Visual Studio,我需要在没有Visual Studio的情况下进行安装。

Is there any way? 有什么办法吗?

Please help me out. 请帮帮我。

After download the NuGet package, please unzip it to local folder, which will list all content of this package. 下载NuGet包后,请将其解压缩到本地文件夹,该文件夹将列出此包的所有内容。 Then add the dlls in the unzipped folder into your project through Add Reference. 然后通过Add Reference将解压缩文件夹中的dll添加到项目中。

For example, I download EntityFramework package from nuget.org site. 例如,我从nuget.org站点下载EntityFramework包。 It will show as entityframework.6.1.3.nupkg. 它将显示为entityframework.6.1.3.nupkg。 I unzip this .nupkg file to local folder and there has a lib folder in this unzipped folder. 我将此.nupkg文件解压缩到本地文件夹,并在此解压缩文件夹中有一个lib文件夹。 Then I find the EntityFramework.dll and EntityFramework.SqlServer.dll in that folder. 然后我在该文件夹中找到EntityFramework.dll和EntityFramework.SqlServer.dll。 I add these dlls as reference into my project. 我将这些dll作为参考添加到我的项目中。

Another way install packages without Visual Studio is using nuget.exe. 另一种不使用Visual Studio安装软件包的方法是使用nuget.exe。 Please download it from https://dist.nuget.org/win-x86-commandline/latest/nuget.exe 请从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. 然后打开命令提示符窗口以运行nuget.exe并使用命令行安装所需的软件包。 The detailed command line for nuget, please refer to: nuget的详细命令行,请参考:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM