You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A PackageReference with a typo can lead to a confusing and less-than-helpful error message.
I inadvertently added a period (.) to the end of a package name before doing a dotnet build and was left thinking that Nuget.org was having issues.
I added: <PackageReference Include="Swashbuckle.AspNetCore." Version="7.2.0" />
when I meant to add: <PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
The trailing period (,) in the package name causes this error:
C:\Program Files\dotnet\sdk\9.0.102\NuGet.targets(170,5): error : The feed 'nuget.org [https://api.nuget.org/v3/index.json]' lists package 'Swashbuckle.AspNetCore..7.2.0' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
IMHO - This would be more helpful if it said the package could not be found. Clearly the "Found" package matched a string trimmed of the extra period. That or whatever matching logic was used should return a 'corrected' package name that is then passed to the code that downloads the package.
It might also be helpful if the message listed the package name and version number separately - I kept overlooking the double period between package name and version.
Verbose Logs
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion, we'll discuss internally and triage accordingly. It looks like the feed only responds with the available versions and doesn't indicate that the package ID is incorrect
NuGet Product Used
dotnet.exe
Product Version
9.0.1
Worked before?
No response
Impact
It bothers me. A fix would be nice
Repro Steps & Context
A
PackageReference
with a typo can lead to a confusing and less-than-helpful error message.I inadvertently added a period (
.
) to the end of a package name before doing adotnet build
and was left thinking that Nuget.org was having issues.I added:
<PackageReference Include="Swashbuckle.AspNetCore." Version="7.2.0" />
when I meant to add:
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
The trailing period (
,
) in the package name causes this error:IMHO - This would be more helpful if it said the package could not be found. Clearly the "Found" package matched a string trimmed of the extra period. That or whatever matching logic was used should return a 'corrected' package name that is then passed to the code that downloads the package.
It might also be helpful if the message listed the package name and version number separately - I kept overlooking the double period between package name and version.
Verbose Logs
The text was updated successfully, but these errors were encountered: