Subfolder in Packages for nuget.server

Jan 5, 2012 at 9:45 PM

It appears that the Nuget.Server package only supports nuget packages that are directly in the ~/Packages subfolder.  Because we have several different packages and versions, I'd like each package to be in its own subfolder, with the different versions located in their respective package subfolder.  This also appears to be the way the main nuget.org server works when looking at the URLs for the packages.  Thus, I would like a directory structure such as:

~/Packages

~/Packages/PackageA/PackageA.1.0.0.0.nupkg
~/Packages/PackageA/PackageA.1.0.0.1.nkpug

~/Packages/PackageB/PackageB.1.0.0.0.nupkg
~/Packages/PackageB/PackageB.1.0.0.1.nupkg

etc..

Is this targeted for a future release or is already in the current release and I am setting it up incorrectly?  I am able to view all packages that are in the folder structure above, but when I try to download any of them, I get a 404 because it appears to be trying to pull them from the /Packages folder and not the additional PackageX subdirectory. Thanks.

Developer
Jan 5, 2012 at 10:34 PM

It's a known bug in our implementation of the LocalPackageRepository. We have an optimization to look for very specific paths when looking up an individual package that ignores everything but the top-level directory. We definitely need to revisit this but I doubt we would be doing that anytime soon.  At this point, I'd recommend storing all packages in the top level directory which should resolve this issue.

NuGet.org goes off of a database to look up package locations and hence does not suffer from this issue.

May 8, 2012 at 12:54 PM

Any news about that? I got the same error. I would like to store my custom packages in subdirectories.

Where I could follow the bug status? I can't find it in the issue tracker.

 

Thanks for that grat work!

Developer
May 8, 2012 at 5:54 PM

The same issue manifests itselfs as this bug http://nuget.codeplex.com/workitem/1649. I pushed a fix for this yesterday. If you'd like to, try our CI bits from http://ci.nuget.org