NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 253 forks source link

"dotnet nuget push -s c:/localdir" creates flat directory structure #9281

Open vivainio opened 4 years ago

vivainio commented 4 years ago

Details about Problem

dotnet.exe --version: 3.1.101

OS version:

win10 1803

Detailed repro steps so we can see the same problem

$ dotnet nuget push -s C:\localdir myapp.1.3.0.nupkg

Observe that c:/localdir now contains myapp.1.3.0.nupkg at top level instead of the "new" hierarchical nuget directory structure.

chausner-audeering commented 2 years ago

I am using dotnet nuget push -s for copying a local package into the local cache and have noticed the following behaviour:

This unexpected behavior makes it difficult to suggest dotnet nuget push -s as generic way to install packages to the local cache, because it only works if there are already other packages in the cache. It will not work for a clean installation.

chausner-audeering commented 1 year ago

Looking at the NuGet client source, my observations are confirmed. The client uses a heuristic to decide whether the offline feed is in v2 or v3 format. If the folder is completely empty, it defaults to v2 which means it will not create the hierarchic structure that NuGet expects for the cache folder.

donnie-msft commented 1 year ago

Duplicate issue: https://developercommunity.visualstudio.com/t/dotnet-nuget-push-cannot-create-a-hierar/10408599