Skip to content

dotnet nuget push *.nupkg doesn't push more than one file #4393

Closed
NuGet/NuGet.Client
#3739

Description

@tanaka-takayoshi

see also https://github.com/dotnet/cli/issues/5436

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet (on Linux)

NuGet version (x.x.x.xxx): seems RC4 (I have no idea to confirm it)

dotnet.exe --version (if appropriate): 1.0.0-rc4-004598

VS version (if appropriate):NA

OS version (i.e. win10 v1607 (14393.321)):RHEL 7.3

Worked before? If so, with which NuGet version:No.

Detailed repro steps so we can see the same problem

  1. Install dotnet SDK daily build package
  2. locate 2 different nupkg files
  3. set up NuGet Server and API key as you can push nupkg to NuGet Server
  4. run dotnet nuget push *.nupkg
  5. Only one nupkg file is uploaded.

Other suggested things

I expect I can push all the nupkg files.
https://docs.microsoft.com/en-us/dotnet/articles/core/preview3/tools/dotnet-nuget-push

$  /opt/dotnet/dotnet --info
.NET Command Line Tools (1.0.0-rc4-004598)

Product Information:
 Version:            1.0.0-rc4-004598
 Commit SHA-1 hash:  1dfee9ead8

Runtime Environment:
 OS Name:     rhel
 OS Version:  7.3
 OS Platform: Linux
 RID:         rhel.7.2-x64
 Base Path:   /opt/dotnet/sdk/1.0.0-rc4-004598

Verbose Logs

$ ls
libuv.1.9.1.nupkg  Microsoft.AspNetCore.WebUtilities.1.0.0.nupkg
$  /opt/dotnet/dotnet nuget -v Verbose push *  -k <NuGetKey> -s <NuGetServer>
trace: NuGet Command Line Version: 4.0.0.0
info : Pushing libuv.1.9.1.nupkg to '<NuGetServer>'...
info :   PUT <NuGetServer>
info :   Created <NuGetServer> 3215ms
info : Your package was pushed.

Sample Project

Very helpful if you can zip a project and paste into this issue!
No need sample project.

Activity

  1. added this to the milestone on Jan 25, 2017
  2. changed the title [-]``dotnet nuget push *.nupkg`` in "" doesn't push more than one file[/-] [+]``dotnet nuget push *.nupkg`` doesn't push more than one file[/+] on Jan 25, 2017
  3. added
    Priority:1High priority issues that must be resolved in the current sprint.
    Priority:2Issues for the current backlog.
    and removed
    Priority:1High priority issues that must be resolved in the current sprint.
    on Jan 27, 2017
  4. singlewind commented on May 11, 2017

    @singlewind

    I can confirmed this within microsoft/aspnetcore-build:1.0-1.1

    At the moment, I use the following line in linux as workaround inside the above build container.
    find obj/Docker/publish -name '*.nupkg' | xargs -i dotnet nuget push {}

  5. modified the milestones: Future-0, Backlog on Nov 9, 2017
  6. stephenlautier commented on Mar 26, 2018

    @stephenlautier

    any update on this one? seems to be still an issue on dotnet --version: 2.1.101

  7. jessepiccolo commented on Jun 14, 2018

    @jessepiccolo

    This is still an issue, only one nuget gets uploaded when running dotnet nuget push /nupkgs/*.nupkg

  8. added a commit that references this issue on Jul 27, 2018
  9. MatthijsKrempel commented on Nov 22, 2018

    @MatthijsKrempel

    try; dotnet push **\*.nupkg

  10. WernerMairl commented on Jan 26, 2019

    @WernerMairl

    i can confirm "dotnet push **/*.nupkg" (linux slash, instead of windows backslash) basically is working. push is executed (i see my packages on NuGet.Org!

    BUT command ends with exitcode and the last3 output rows:

    info :   Created https://www.nuget.org/api/v2/package/ 590ms
    info : Your package was pushed.
    error: File does not exist (**/*.snupkg).
    

    it seems that some symbol settings now are required.
    i'm not using symbol features untilt now, so i don't expect this exception... may be a breaking change ?

    • dotnet --info
      .NET Core SDK (reflecting any global.json):
      Version: 2.2.103
      Commit: 8edbc2570a
      Runtime Environment:
      OS Name: debian
      OS Version: 9
      OS Platform: Linux
      RID: debian.9-x64
      Base Path: /usr/share/dotnet/sdk/2.2.103/
      Host (useful for support):
      Version: 2.2.1
      Commit: 878dd11e62
      .NET Core SDKs installed:
      2.2.103 [/usr/share/dotnet/sdk]
      .NET Core runtimes installed:
      Microsoft.AspNetCore.All 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
      To install additional .NET Core runtimes or SDKs:
      https://aka.ms/dotnet-download
  11. 21 remaining items

  12. tanaka-takayoshi commented on Aug 2, 2020

    @tanaka-takayoshi
    Author

    I'm closing this issue with summarizing as follows.

    The target of this issue

    When trying to push two or more nuget files by dotnet nuget push *.nupkg on Linux or macOS, only one nuget file was pushed.
    If your issue is happening also on Windows, please open another issue. It seems to be other than this issue, but might be related.

    How to solve

    Please use dotnet nuget push "*.nupkg" or another similar way to avoid shell file globbing.
    As zivlan explained, it's not NuGet CLI issue but shell issue.

    Background

    When we use dotnet nuget push *.nupkg command in bash or other similar shells if there're two nupkg files, A.nupkg and B.nupkg, NuGet CLI receives dotnet nuget push A.nupkg B.nupkg due to file globbing. NuGet CLI doesn't support specifying two or more files such as dotnet nuget push [file1] [file2].
    https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push

    If you think NuGet should support specifying two or more files, everyone can open another issue as a feature request.
    #4393 (comment)

    As this looks like a "good-to-have" feature for me, I don't file this feature request right now.

  13. zivkan commented on Aug 6, 2020

    @zivkan
    Member

    I'm reopening this issue. Even though the original author, @tanaka-takayoshi has worked around the issue. Many others are hitting it and this issue is now the preferred tracking issue to add support into NuGet to pass multiple nupkgs on the command line. Everyone interested should keep upvoting the original post so that it appears higher in the list of all open issues sorted by upvotes.

    This issue should not be closed until NuGet supports multiple files passed on the command line.

  14. reopened this on Aug 6, 2020
  15. removed this from the Backlog milestone on Sep 2, 2020
  16. self-assigned this
    on Oct 29, 2020
  17. added a commit that references this issue on Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions