Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a 405 Method Not Allowed publishing NuGet to VSTS / ADO

I just set up a new ADO (formerly VSTS/VSO) Package Management Feed, and I'm trying to publish a local NuGet package to it from my desktop. I followed the instructions in the feed, but I'm getting a "405 Method Not Allowed" when I try to publish.

I followed the instructions for "NuGet 3.3 + VSTS Credential Provider:"

nuget sources add -name "MyPackageFeedName" -source https://ACCOUNT_NAME.pkgs.visualstudio.com/_packaging/PACKAGE_FEED_NAME/nuget/v3/index.json

nuget push yourpackage.nupkg -Source https://ACCOUNT_NAME.pkgs.visualstudio.com/_packaging/PACKAGE_FEED_NAME/nuget/v3/index.json -ApiKey VSTS
like image 982
aoetalks Avatar asked May 20 '16 18:05

aoetalks


1 Answers

Answer: Make absolutely sure you're using the latest version of NuGet.exe. Run nuget without any arguments to see the version.

Turns out an old NuGet version (2.8) crept onto on my PATH from an installation of CScript. Older versions of NuGet might not push properly to v3 sources, so that's why it failed. You can check your PATH using the following commands:

where nuget (Command Prompt)

Get-Command nuget (PowerShell)

I cleaned up my PATH so it only had the latest version of NuGet.exe. Then, I was able to publish. This VSTS page on authentication is also helpful.

If you need to update nuget, you can run nuget update -self.

like image 152
aoetalks Avatar answered Oct 19 '22 03:10

aoetalks