Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

How can I do the following steps:

  • Open visual studio (command prompt/no gui/silent)
  • Call the nuget update statement: Update-Package MyNamespace.MyProject -Version x.x.x

At first I tried to do this via nuget.exe, but it seems that Install.ps1 scripts aren't executed. (http://blog.davidebbo.com/2011/05/thoughts-on-installing-and-updating.html)

like image 783
Marnix Avatar asked Nov 09 '22 22:11

Marnix


1 Answers

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. As you say, the NuGet.exe command line does not run the included powershell scripts in the package you are installing.

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.

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. But hey, if it works! :)

like image 81
TylerOhlsen Avatar answered Nov 15 '22 11:11

TylerOhlsen