dotnet clean --configuration Debug
dotnet build --configuration Debug --version-suffix beta.12
dotnet pack --include-symbols --include-source --configuration Debug --version-suffix beta.12
到目前为止一切顺利 - 上述三个命令产生了两个不错的包:xyz.2.1.2-beta.12.nupkg 和 xyz.2.1.2-beta.12.symbols.nupkg。但是当我运行最后一个命令时:
dotnet nuget push bin\Debug\ --source https://www.nuget.org
失败并显示以下消息:
info : Pushing xyz.2.1.2-beta.12.nupkg to the NuGet gallery (https://www.nuget.org)...
info : PUT https://www.nuget.org/api/v2/package/
warn : This package will only be available to download with SemVer 2.0.0 compatible NuGet clients,such as Visual Studio 2017 (version 15.3) and above or NuGet client 4.3 and above. For more information,see https://go.microsoft.com/fwlink/?linkid=852248.
info : Created https://www.nuget.org/api/v2/package/ 1573ms
info : Your package was pushed.
info : Pushing xyz.2.1.2-beta.12.symbols.nupkg to the NuGet gallery (https://www.nuget.org)...
info : PUT https://www.nuget.org/api/v2/package/
info : Conflict https://www.nuget.org/api/v2/package/ 1006ms error: Response status code does not indicate success: 409 (A package with ID 'xyz' and version '2.1.2-beta.12' already exists and cannot be modified.).
所以,很明显,符号包的推送失败了。这发生在
dotnet nuget push...
或 nuget push...
似乎是什么问题?
最佳答案
我刚刚遇到这个问题并在几分钟前修复了它。
Symbols 包有一种新格式,即 .snupkg
延期。
如果您使用的是 dotnet cli
或 nuget cli
您可以执行以下操作:
包装:
DOTNET 命令行界面
dotnet pack MyAwesomeLib.csproj --include-symbols -p:SymbolPackageFormat=snupkg -c release
NUGET CLI
nuget pack MyAwesomeLib.nuspec -Symbols -SymbolPackageFormat snupkg
发布:
DOTNET 命令行界面
dotnet nuget push MyAwesomeLib.1.0.0.nupkg -s https://api.nuget.org/v3/index.json -k ~~your API key here~~
NUGET CLI
nuget push MyAwesomeLib.1.0.1.nupkg -Source https://api.nuget.org/v3/index.json -apikey ~~your API key here~~
您可以从 here 阅读更多相关信息。 .
关于.net - 'dotnet nuget push .. .' doesn' t 似乎在插入符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52142074/