问题描述
我创建了一个 Visual Studio 类库.我想把它作为一个包裹寄给 Nuget.我使用了 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 包 hellonuget.nuspec
- nuget push hellonuget.1.0.0.nupkg -ApiKey *
这返回了一个错误:nuget:无法处理请求.'这指定的 API 密钥无效或无权访问指定的包.'.在行:1 字符:1+ nuget 推送 hellonuget.1.0.0.nupkg+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (Failed to proce...ied package.'. :String) [], RemoteException+ FullQualifiedErrorId : NativeCommandError
远程服务器返回错误:(403) Forbidden
我尝试了第二种方法.我从 Windows CMD 窗口尝试了这些命令.我创建了 HelloNuget.dll 的 nuget 包.
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 包 hellonuget.nuspec
D:\App\HelloNuget> nuget push hellonuget.1.0.0.nupkg -ApiKey *
成功发布包.
visual studio 包管理器有什么问题?
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.
这篇关于Visual Studio 上的 Nuget 包推送 403 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!