Description
NuGet Product Used
dotnet.exe, NuGet.exe
Product Version
dotnet nuget push and nuget.exe push
Worked before?
No response
Impact
No response
Repro Steps & Context
Execute dotnet nuget push *.nupkg -s https://packagesource/v3/index.json --api-key apikey --symbol-source https://symbolsource
command. Please note --symbol-api-key
is neither passed to the commandline or added to the NuGet.Config file.
Actual
No warning is raised. Pushing of symbol packages may fail if the server requires a symbol api key for the operation to be successful.
Expected
NuGet Client
raises a warning saying Found symbols package '{0}', but no API key was specified for the symbol server. To save an API Key, run 'NuGet.exe setApiKey [your API key from http://www.NuGet.org]'
because symbol apikey is neither passed via commandline not it was found in the NuGet.Config file.
In the existing implementation, code checks for empty or null value for --api-key
when pushing symbol packages
to an online feed for e.g., nuget.org
. If the validation fails, it raises a warning saying Found symbols package '{0}', but no API key was specified for the symbol server. To save an API Key, run 'NuGet.exe setApiKey [your API key from http://www.NuGet.org]'
Instead, it should check for empty or null value for --symbol-api-key
because the logic is trying to push a symbols package
not a regular package .nupkg
.
The fix for this issue is simply to validate symbol api key and then raise a warning if the value validation fails.
Verbose Logs
No response