5

I've tried every imaginable combination of the example commands in the official docs, but these are all using nuget.exe.

The following nuget issue states that publishing with the dotnet cli to the offical nuget.org v3 endpoint https://api.nuget.org/v3/index.json works.


When publishing to the MyGet v3 endpoint with

dotnet nuget push <package-name>.nupkg --api-key <write-api-key> --source https://www.myget.org/F/<some-site>/api/v3/index.json

the .nupkg file is published but the .snupkg one is not.


When publishing the .snupkg file only to the MyGet v3 endpoint with

dotnet nuget push <package-name>.snupkg --api-key <write-api-key> --source https://www.myget.org/F/<some-site>/api/v3/index.json

the result is:

error: Unable to load the service index for source https://www.myget.org/F/<some-site>/api/v3/index.json.
error:   Response status code does not indicate success: 401 (Unauthorized).

Also tried with:

dotnet nuget push <package-name>.snupkg --api-key <write-api-key> --source https://www.myget.org/F/<some-site>/api/v3/index.json --no-service-endpoint

.. with the same result

Manually uploading the .snupkg file via the WebUI works.

I'm using:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.201
 Commit:    b1768b4ae7

Any hints?

This unanswered question seems somewhat linked

Stefan Anghel
  • 194
  • 3
  • 15
  • I have the exact same issue with a 401 error. Using nuget.exe directly I get prompted for a username and password. – Dag Baardsen May 15 '20 at 14:31
  • @DagBaardsen if you do find a solution, sooner or later, please remember to leave some feedback on this question. Also, please vote the question if you consider it useful. – Stefan Anghel May 15 '20 at 18:11
  • 1
    sure. MyGet today confirmed this to be an issue with the v3 API: "It is an issue with API v3, I created an internal ticket for our engineering team to investigate this issue. Please use API v2 for now. I will keep you updated." I'll keep you posted. – Dag Baardsen May 18 '20 at 11:30
  • @DagBaardsen is the issue you raised with Myget publicly visibile somewhere? if yes, please link it here also, thank you. – Stefan Anghel Jun 05 '20 at 08:17
  • 1
    I am sorry, no. As you see in their response, they created an internal ticket for this and I have not heard from them lately. I sent a reminder today, so let's see what happens. In the meantime, we have decided to move away from a paid service because their business model do not match our needs in addition to this issue. So now we're running out own BaGet instance on Kubernetes. Works as a charm with snupkg. – Dag Baardsen Jun 07 '20 at 15:42
  • 1
    I finally got a reply from myget: "Unfortunately not yet, it's in our queue at the moment and we don't have any ETA yet. As soon as there is any update, I will let you know." – Dag Baardsen Jun 11 '20 at 14:01

1 Answers1

0

I got the same problem during pushing multiple nuget packages. The solution was to push to the V2 API of MyGet, but it only worked if the packages were in the same directory and I used the directory in the command instead of the package name. Ex.

dotnet nuget push $(Build.SourcesDirectory)/packages/ --source https://www.myget.org/F/<feedname>/api/v2 -k <token>

DISCLAIMER: I'm doing this from TFS CI/CD build task.

Damjan
  • 49
  • 1
  • 7