简体   繁体   中英

Nuget package push 403 error on visual studio

I have created a visual studio class library. I want to send this to Nuget as a package. I used Visual studio package manager console. The commans are like following:

  • nuget spac hellonuget
  • nuget pack hellonuget.nuspec
  • nuget push hellonuget.1.0.0.nupkg -ApiKey *

this returned an error: nuget : Failed to process request. 'The specified API key is invalid or does not have permission to access the specified package.'. At line:1 char:1 + nuget push hellonuget.1.0.0.nupkg + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (Failed to proce...ied package.'. :String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
The remote server returned an error: (403) Forbidden

I tried second way. I tried these commands from windows CMD window. I created nuget package of HelloNuget.dll.

  • D:\\App\\HelloNuget> nuget spac hellonuget.dll
  • D:\\App\\HelloNuget> nuget pack hellonuget.nuspec
  • D:\\App\\HelloNuget> nuget push hellonuget.1.0.0.nupkg -ApiKey *

    Succesfully published the pack.

What is the problem about visual studio package manager?

I had the exact same problem and it was because i was using a name for the package that exists already . Once i changed the name of of the package to something unique it published perfectly.

I had a same problem with DeveloperTools

The original intended name was DevTools but PSGallery was rejecting this name. I can only guess the real reason was a conflict with PSDevTools which is not the same. Once I changed the name into DeveloperTools, everything was fine.

I don't really understand why there is GUID in module manifests when PSGallery doesn't really care about this strong type identification.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM