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
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With