This project is read-only.


Ability to run NuGet from Powershell outside of VS


Think things like Creating a new solution and adding 7 packages with one script, as well as other possibilities it can open up.

See Dupe for more details.
Closed Jan 8, 2013 at 5:02 PM by dotnetjunky


Haacked wrote Mar 22, 2011 at 10:38 PM

Needs to be spec'd out. Sounds like a huge feature. Modifying solutions and project files from outside of VS is very complicated and will require us to effectively maintain two separate large code bases.

hhariri wrote Mar 23, 2011 at 8:06 AM

Why would there be a need to maintain two separate code bases? Can't a layer of abstraction be provided to make it independent of what provides access to the project/solution? This is obviously talking from the unknown of not knowing the code base, so forgive my ignorance. Where would I look in the code to see the tight dependencies to VS?


Haacked wrote Mar 23, 2011 at 5:11 PM

Sure, we can have a layer of abstraction, but we'd have two concrete implementation of that abstraction, one of which would be non-trivial.

hhariri wrote Mar 23, 2011 at 5:36 PM

OK I understand that, but it's such a difference that you'd need to replicate and maintain two code-bases?

Haacked wrote Mar 23, 2011 at 7:59 PM

I didn't mean to physical codebases. I meant, every time we need to make a change to our abstraction to support new scenarios, we have to provide 2 completely different concrete implementations. Now we're maintaining a lot more code than necessary. For what benefit?

Why can't you simply create a new solution and 7 packages with one script from within VS? Why does this scenario have to be outside of VS to start with?

hhariri wrote Mar 24, 2011 at 5:33 AM

Phil I didn't realize that this would be such a large effort. I was thinking that for certain scenarios, like potentially running and configuring packages via a build server, it would be good to not have dependencies on Visual Studio. If it involves such an effort then I'll find workarounds.


hhariri wrote Mar 24, 2011 at 5:37 AM

Out of curiosity, does the nuget console application not have some repetitive code in it?

Haacked wrote Mar 24, 2011 at 6:07 AM

NuGet console is a thin wrapper around NuGet.core. It doesn't automate Visual Studio nor modify .csproj nor .sln files. I guess it really depends on what you're trying to do.

You can use NuGet.exe to download and unpack packages outside of VS.

Out of curiosity, are you really wanting to have a build server without VS installed make changes to your VS artifacts such as .csproj and .sln files?

hhariri wrote Mar 24, 2011 at 6:49 AM

Thanks. I'll take a look at the nuget console source to see what else could be done with it. Regarding VS on build machines, normally not a requirement. csproj/sln are mere files. I don't see why it would be needed. However, I understand that if support for this feature is not warranted, it can just be closed.

Thanks for your feedback.

damianh wrote Mar 31, 2011 at 4:55 PM

Potentially related :

If you consider 902 a duplicate, merge it here?

LeeCampbell wrote Apr 6, 2011 at 10:29 AM

@Haacked, it seems that you are implying that if the Build server had VS installed, that I could automate this? While it makes my stomach turn to think about having VS installed on the build server, if it was the fastest way to get things moving I might be able to move the mountain of paper work to get a desktop app installed onto a server.
So if VS is on the build server, how do you automate it?


Haacked wrote Apr 6, 2011 at 5:39 PM

Lee, possibly. Though it's a bit of work. I think we have a prototype PS script that can do that. What you'd do is create a NuGet package that does all the changes you want, and then automate VS to install that package. That might work.

However, I still don't understand the scenario here. Can you reply to the discussion here?