You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that NuGet currently not support pushing multiple packages by using a glob pattern. Don't know if this is a bug or intentional. dotnet nuget push *.nupkg should be removed.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: b363ab07-ea19-574f-e0db-25fd5702255d
Version Independent ID: 6fa9479a-85db-5498-6b7e-2418fc7bac32
ls *.nupkg
XaasKit.AspNetCore.MultiTenancy.1.0.0-preview1-t000.nupkg
XaasKit.AspNetCore.MultiTenancy.Abstractions.1.0.0-preview1-t000.nupkg
dotnet nuget push *.nupkg -k <key> -s https://www.myget.org/F/xaaskit/api/v2/package
info : Pushing XaasKit.AspNetCore.MultiTenancy.1.0.0-preview1-t000.nupkg to 'https://www.myget.org/F/xaaskit/api/v2/package'...
info : PUT https://www.myget.org/F/xaaskit/api/v2/package/
info : Created https://www.myget.org/F/xaaskit/api/v2/package/ 636ms
info : Your package was pushed.
Is it safe to say it it's a bug?
Reacted by Diego, Serhii A. Hrytsenko, Alessandro Federici, c-teixeira and dotnetdev1125
Any update on this?
I've just verified that dotnet nuget is unable to push multiple packages at the same time and I can see that the documentation has not been updated yet despite being wrong.
I've just tested it with the dotnet core 2.2 docker image: mcr.microsoft.com/dotnet/core/sdk:2.2
the command dotnet nuget push */**/*.nupkg -s http://iberodev-repository/repository/mirepo/ info : Your package was pushed.
only pushes the first nupkg it finds.
However the command dotnet nuget push **/*.nupkg -s http://iberodev-repository/repository/mirepo/ info : Your package was pushed.
pushes all the packages and works as expected. Notice the regular expression
Reacted by Michael Reed, Facundo La Rocca, Cengiz Ilerler, Jean-Paul Thorne, Petr Švihlík, True Goodwill and Giorgi Chakhidze
Tried on Linux for multiple versions of dotnet:
2.1.302
henli@henli001UbuntuRepro:~/packages$ dotnet --version
2.1.302
henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ *.nupkg
info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
info : Your package was pushed.
henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ '*.nupkg'
info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
info : Your package was pushed.
info : Pushing project2.1.0.0.nupkg to '/home/henli/source/'...
info : Your package was pushed.
2.2.300
henli@henli001UbuntuRepro:~/packages$ dotnet --version
2.2.300
henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ *.nupkg
info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
info : Your package was pushed.
henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ '*.nupkg'
info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
info : Your package was pushed.
info : Pushing project2.1.0.0.nupkg to '/home/henli/source/'...
info : Your package was pushed.
3.1.201
henli@henli001UbuntuRepro:~$ dotnet --version
3.1.201
henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ *.nupkg
Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
Your package was pushed.
henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ '*.nupkg'
Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
Your package was pushed.
Pushing project2.1.0.0.nupkg to '/home/henli/source/'...
Your package was pushed.
Without quotes, only the first package is pushed.
With quotes, all packages are pushed.
Reacted by Rodrigo Vazquez, Sipke Schoorstra and John Neville
Heng's comment shows it best. When using '*.nupkg', it tells the shell not to expand the wildcard, so the * character is really passed to NuGet (via dotnet), and NuGet does its own globbing. Windows cmd.exe doesn't support globbing (not sure about powershell, my guess is no), which is why the single quotes are not needed around the *.nupkg. On Linux, every shell I've ever used supports globbing, so that individual apps don't need to.
Fundamentally, the issue is that dotnet nuget push package1.nupkg package2.nupkg doesn't work. That's what dotnet/NuGet sees on Linux (or other shells), where the shell supports globbing and expands it before passing the arguments to the process.
I think it's not Windows vs Linux, it's all about whether the shell expands globs, and NuGet appears to only support only a single argument.
Activity
JRAlexander commentedon Aug 21, 2018
@KathleenDollard, any thoughts?
KathleenDollard commentedon Aug 21, 2018
@livarcocc @rrelyea Should this work?
livarcocc commentedon Aug 21, 2018
@vlesierse what error do you get when this happens? On which operating system? And on which version of dotnet?
Also, globbing is not something that the dotnet does by itself, it is actually supported by the underlying shell.
I will let @rrelyea comment on whether or not multiple nupkg publishing is supported or not, independent of globbing.
vlesierse commentedon Aug 21, 2018
@livarcocc It's not an error. It just pushes the first package it finds. All examples only includes one package, so it looks like it's working.
jjpepper commentedon Aug 28, 2018
@vlesierse that doesn't seem right, the doco right here above states:
"Pushes all .nupkg files in the current directory to the default push source:
dotnet nuget push *.nupkg", so it should work.
vlesierse commentedon Aug 28, 2018
@jjpepper Except it doesn't.
ls *.nupkg XaasKit.AspNetCore.MultiTenancy.1.0.0-preview1-t000.nupkg XaasKit.AspNetCore.MultiTenancy.Abstractions.1.0.0-preview1-t000.nupkgIs it safe to say it it's a bug?
jjpepper commentedon Aug 28, 2018
screig commentedon Mar 5, 2019
I see the same issue, we have 8 packages put only one is pushed
kellcomnet2 commentedon Mar 28, 2019
same issue on linux
iberodev commentedon Mar 31, 2019
Any update on this?
I've just verified that dotnet nuget is unable to push multiple packages at the same time and I can see that the documentation has not been updated yet despite being wrong.
I've just tested it with the dotnet core 2.2 docker image:
mcr.microsoft.com/dotnet/core/sdk:2.2the command
dotnet nuget push */**/*.nupkg -s http://iberodev-repository/repository/mirepo/info : Your package was pushed.only pushes the first nupkg it finds.
However the command
dotnet nuget push **/*.nupkg -s http://iberodev-repository/repository/mirepo/info : Your package was pushed.pushes all the packages and works as expected. Notice the regular expression
WhiteEagle5150 commentedon Jun 23, 2019
@iberodev,
Your solution worked for me. Thank you.
My environment:
gitlab-runner 11.9.1 / linux/Ubuntu 14.04
dotnet-sdk:2.1.302-v2.6
dotnet nuget push $OUTPUT_DIR/**/*.nupkg ...16 remaining items
rrelyea commentedon Mar 25, 2020
FYI @donnie-msft @aortiz-msft
heng-liu commentedon Apr 2, 2020
Tried on Linux for multiple versions of dotnet:
2.1.302
2.2.300
3.1.201
Without quotes, only the first package is pushed.
With quotes, all packages are pushed.
donnie-msft commentedon Apr 3, 2020
For clarity, Windows still works as expected in dotnet 3.1.300-preview-015048.
Both push all expected packages (not just 1):
dotnet nuget push *\**\*.nupkg --source "nugettest" --skip-duplicatedotnet nuget push *\*\*\*.nupkg --source "nugettest" --skip-duplicatezivkan commentedon Apr 3, 2020
Heng's comment shows it best. When using
'*.nupkg', it tells the shell not to expand the wildcard, so the*character is really passed to NuGet (via dotnet), and NuGet does its own globbing. Windows cmd.exe doesn't support globbing (not sure about powershell, my guess is no), which is why the single quotes are not needed around the*.nupkg. On Linux, every shell I've ever used supports globbing, so that individual apps don't need to.Fundamentally, the issue is that
dotnet nuget push package1.nupkg package2.nupkgdoesn't work. That's what dotnet/NuGet sees on Linux (or other shells), where the shell supports globbing and expands it before passing the arguments to the process.I think it's not Windows vs Linux, it's all about whether the shell expands globs, and NuGet appears to only support only a single argument.
heng-liu commentedon Apr 3, 2020
Since the issue still exists, please reopen this issue. Thanks! @mairaw
heng-liu commentedon Apr 4, 2020
After discussion, we would like to keep it closed. Sorry for the confusion caused!
Update nightly.yaml workflow
update glob pattern as suggested by dotnet/docs#7146 to pick up multiple
Only one Nuget package pushed bug fixed
Fix upload multiple packages
Fix upload multiple packages
Fix upload multiple packages
Fix upload multiple packages