dotnet clean --configuration Debug
dotnet build --configuration Debug --version-suffix beta.12
dotnet pack --include-symbols --include-source --configuration Debug --version-suffix beta.12
So far so good - the above three commands produce two nice packages: xyz.2.1.2-beta.12.nupkg and xyz.2.1.2-beta.12.symbols.nupkg. But when I run the last command:
dotnet nuget push bin\Debug\ --source https://www.nuget.org
fails with these messages:
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.).
So, it is obvious that pushing of the symbol package fails. This is happening with both dotnet nuget push...
or nuget push...
What seems to be the problem?
I've just had this issue and fixed it few minutes ago.
There is a new format for Symbols package which is .snupkg
extension.
If you're using dotnet cli
or nuget cli
you can do the following:
Pack:
DOTNET CLI
dotnet pack MyAwesomeLib.csproj --include-symbols -p:SymbolPackageFormat=snupkg -c release
NUGET CLI
nuget pack MyAwesomeLib.nuspec -Symbols -SymbolPackageFormat snupkg
Publish:
DOTNET CLI
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~~
You can read more about this from here.