获取'forbidden'在 github 中推送 nuget 包



很像这个线程:使用NuGet发布和使用GitHub包存储库:无法加载服务索引错误

我有正确的csproj,正确的nuget.config(与该线程中的相同,但适用于我的用户名(,并遵循令牌拥有所有权限的答案,我执行dotnet nuget add source和dotnet nuget push(相同的格式/语法(。

然而,我总是得到这个:

warn: <username> does not have the correct permissions to execute 'CreatePackageVersion'
Forbidden https://nuget.pkg.github.com/(username)/ 687ms
error: Response status code does not indicate success: 403 (Forbidden).

我试过在dotnet nuget推送中使用/不使用-k(git令牌(,没有效果。它推荐的交互式不会改变任何事情。

在发布到该文件夹后,我将在\bin\Release \netstandard2.0\publish目录中的标准命令行中运行此程序。

即使添加了相应的csproj和nuget.config数据,也已经重新启动了计算机。还尝试了@username和username(我的用户名有没有at符号,因为所有文档都没有实际的用户名示例,很多都被涂黑了(。

(我确实希望它是公共可读的,已经添加了源代码…/(username(/index.json(

检查csproj中的RepositoryUrl。它应该与您要上传包的存储库相匹配。您可能还需要设置PublishRepositoryUrl

最新更新