change location of packages folder

Mar 29, 2011 at 10:21 PM

How can I change the location of the packages folder ? Nuget uses the same location of the Visual Studio solution file, but I'd like it to be in the parent folder.

Apr 12, 2011 at 10:38 PM

Actually, I'd like to use a custom folder location.  For example:  %NuGetPackages%/...

Our build system has a very specific structure, and I'm getting grumbles from the person in charge of curating it since I checked in the packages.  So unless I can redefine where NuGet drops things, it's not going to be worth using it in the long term.

Apr 13, 2011 at 12:04 AM
Are you allowed to rename your web.config (or app.config) file and have it work just the same? Could I for instance start calling my web.config 'bob.config' and expect it to work? Probably not, because I'm using the Visual Studio tool and it is declaring how it works. I should work within the tools confines if I want to use the tool for it's numerous benefits.

I know that was a pointed redirection, but for good reason.

The idea to remember here is that NuGet is a tool and it owns that packages directory. Having it configurable may be an option sometime later down the line, but right now it is where the tool stores packages that your code works with. If you would like to use the tool, please try to understand why it works in the way that it does.

We have many of these discussions and I am strongly in the camp of 'lib' being my directory name for external dependencies. But in the bigger picture, even I have to admit it's very esoteric to ask a tool that has a specific reason for working like it does to work a different way because it feels wrong when the tool doesn't mold exactly the way we want it to.

That said, I have written a nuget package that will allow you to override that folder name to something else. It is not guaranteed to work and will probably break in the next version. I am not going to link to it here either. It's unsupported functionality that might cause bad things to happen in the long term. YMMV
Apr 13, 2011 at 12:17 AM

I like to use a 'src' directory for the source code of my projects (I'm sure I'm not the only one). If I put the solution file in src that means nuget will put the packages directory in src. So right now, I'm forced to put the solution file in the parent directory, that way src and packages are siblings.

Apr 13, 2011 at 1:01 AM

Same here w/"src" folder. Would be nice to have packages at top level. Keep in mind there is nuget.exe that will let you do these things.
____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

Apr 16, 2011 at 11:50 PM

Rob,

kfarmer is not alone on this wish. As a new NuGet user, the first thing I looked for was a configurable parameter that would allow me to set the root folder for NuGet packages, preferably relative to the solution root. Tools (and the developers who develop them) need to be flexible with regard to the way their users/customers would like to use them. Otherwise, they will choose a different tool that better meets their requirements.

-Chuck

Apr 17, 2011 at 5:18 PM

Clearly you might want to reread my original post.

"Having it configurable may be an option sometime later down the line..."

"I am strongly in the camp of 'lib' being my directory name for external dependencies"

"I have written a nuget package that will allow you to override that folder name to something else."

Not that it's any help, but people are going to find/create what works for them. That may be NuGet. That may be OpenWrap. That may be something else completely. To use a tool, sometimes you make tradeoffs (read: almost always).

Use the tool for a few days to evaluate whether the folder is a deal breaker or not based on the other benefits. If it really is at that point, then feel free to fork it and make it work that way for you or evaluate another tool.

Hope this helps.