[英]Is there a way to make the VS Package Manager commands available on Powershell Console?
Is there a way to make the VS Package Manager commands available on Powershell Console? 有没有一种方法可以使VS Package Manager命令在Powershell控制台上可用? I looked over this link but I was unable to understand the NuGet philosophy.
我查看了此链接,但无法理解NuGet的原理。
I know that I can access it in Visual Studio but, let me explain my approach and goal. 我知道我可以在Visual Studio中访问它,但让我解释一下我的方法和目标。
I want to learn F# and for this use a lot its REPL. 我想学习F#,为此需要大量使用REPL。 So basicaly, I open a Powershell console, change to my working folder, create a file with some code, fire the REPL, try various things.
因此,基本上,我打开Powershell控制台,转到我的工作文件夹,使用一些代码创建文件,启动REPL,尝试各种操作。
In this kind of loop makes sense to have means to install various packages without starting VS and having to create a VS project. 在这种循环中,有意义的是无需安装VS而无需创建VS项目即可安装各种软件包。
Thanks! 谢谢!
The problem is that the PowerShell cmdlets that NuGet makes available inside Visual Studio rely heavily on Visual Studio so they are not supported outside of Visual Studio from the command line. 问题是NuGet在Visual Studio中提供的PowerShell cmdlet严重依赖Visual Studio,因此从命令行在Visual Studio外部不支持它们。
From the command line you have NuGet.exe which supports the following which are project related: 在命令行中,您具有NuGet.exe,它支持以下与项目相关的项目:
NuGet.exe install
or NuGet.exe restore
NuGet.exe install
或NuGet.exe restore
NuGet update
Having the NuGet PowerShell cmdlets available on the command line is something I have looked at doing using the cmdlets that SharpDevelop provides . 我已经看过使用SharpDevelop提供的cmdlet在命令行上提供NuGet PowerShell cmdlet的情况。 It is possible to fully support NuGet install/update/uninstall and have the PowerShell scripts execute on the project but in this case it requires an entire IDE, in this case SharpDevelop, to be available, at least its assemblies, even though the IDE is not run.
可以完全支持NuGet的安装/更新/卸载并在项目上执行PowerShell脚本,但是在这种情况下,它需要一个完整的IDE(在这种情况下为SharpDevelop)可用,至少是其程序集可用,即使IDE是不跑。 This is needed to support updating the project file using the Visual Studio project model (EnvDTE) from within any PowerShell scripts that run.
这是支持从运行的任何PowerShell脚本中使用Visual Studio项目模型(EnvDTE)更新项目文件所必需的。
Nuget commands cannot be used outside of Visual Studio. Nuget命令不能在Visual Studio外部使用。 However, if you were change to use Paket instead of Nuget, then you can use Paket from a command line outside of Visual Studio to manage your project's packages.
但是,如果更改为使用Paket代替Nuget,则可以从Visual Studio外部的命令行使用Paket来管理项目的程序包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.