简体   繁体   English

从visual studio命令提示符运行nuget包管理器控制台

[英]Run nuget package manager console from visual studio command prompt

I am looking for a way to startup visual studio and then run some commands in the package manager console for nuget. 我正在寻找一种启动visual studio的方法,然后在包管理器控制台中为nuget运行一些命令。

How can I do the following steps: 我该怎么做以下步骤:

  • Open visual studio (command prompt/no gui/silent) 打开visual studio(命令提示符/ no gui / silent)
  • Call the nuget update statement: Update-Package MyNamespace.MyProject -Version xxx 调用nuget update语句: Update-Package MyNamespace.MyProject -Version xxx

At first I tried to do this via nuget.exe, but it seems that Install.ps1 scripts aren't executed. 起初我尝试通过nuget.exe执行此操作,但似乎不执行Install.ps1脚本。 ( http://blog.davidebbo.com/2011/05/thoughts-on-installing-and-updating.html ) http://blog.davidebbo.com/2011/05/thoughts-on-installing-and-updating.html

The NuGet FAQ attempts to address this with the " Can I use NuGet outside of Visual Studio? " question, but it falls short of what you are after. NuGet FAQ试图通过“ 我可以在Visual Studio之外使用NuGet吗? ”这个问题来解决这个问题,但它不能满足您的需求。 As you say, the NuGet.exe command line does not run the included powershell scripts in the package you are installing. 如您所说,NuGet.exe命令行不会运行您正在安装的软件包中包含的PowerShell脚本。

It looks like the NuGet team is planning another route to support the new project.json project structure introduced by ASP.Net 5 / ASP.Net Core 1.0 . 看起来NuGet团队正计划另一条路线来支持ASP.Net 5 / ASP.Net Core 1.0引入的新project.json项目结构。

You might be able to use this standalone set of powershell cmdlets developed by the SharpDevelop team, but I haven't tried it and it is a bit old. 您可以使用由SharpDevelop团队开发的这个独立的PowerShell cmdlet集 ,但我还没有尝试过,它有点旧。 But hey, if it works! 但是,嘿,如果有效! :) :)

暂无
暂无

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

相关问题 如何使用Visual Studio工具栏在命令提示窗口上运行控制台应用程序 - How to run console application on command prompt window with visual studio Toolbar MSBuild 正在从“Visual Studio 命令提示符”中运行 - MSBuild is being run from within the "Visual Studio Command Prompt" 如何使用NuGet软件包管理器控制台在Visual Studio 2012 Pro上安装OpenPop.NET? - How can i install OpenPop.NET on my visual studio 2012 pro using the NuGet package manager console? 如何在Visual Studio输出窗口中运行控制台应用程序,而不是打开新的命令提示符? - How do you run a console application in the Visual Studio output window, instead of opening a new command prompt? 在扩展中以编程方式访问visual studio的powershell控制台(包管理器控制台) - Access the powershell console (package manager console) of visual studio programmatically in an extension 从命令提示符运行控制台应用程序 - Run console application from the command prompt 有什么方法可以直接从命令行查看 Visual Studio 可用的 Nuget package 源 - Is there any way to view Nuget package sources available for visual studio directly from command line 如何从Visual Studio中的包管理器控制台调用针对SQL Azure的update-database? - How to call update-database from package manager console in Visual Studio against SQL Azure? 在 Visual Studio 中使用 DTE 的包管理器控制台自动化 - Package Manager Console Automation using DTE in Visual Studio Package Manager Console Visual Studio 2019 返回新行 - Package Manager Console Visual Studio 2019 Returns New Line
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM