Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupt package download results in dotnet build failures #14129

Open
dazinator opened this issue Feb 22, 2025 · 1 comment
Open

Corrupt package download results in dotnet build failures #14129

dazinator opened this issue Feb 22, 2025 · 1 comment

Comments

@dazinator
Copy link

dazinator commented Feb 22, 2025

NuGet Product Used

Other/NA

Product Version

dotnet restore, visual studio restore

Worked before?

not sure

Impact

It's more difficult to complete my work

Repro Steps & Context

I just spend a few hours wondering why my code wouldn't compile after a package was updated

Compiler couldn't find

 Services.AddMemoryCache();

Which is part of the the Microsoft.Extensions.Caching.Memory nuget package
https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.memorycacheservicecollectionextensions.addmemorycache?view=net-9.0-pp&viewFallbackFrom=net-6.0

No errors about package integrity issues.

When I checked the nuget package folder at C:\Users\Daz Work\.nuget\packages\microsoft.extensions.caching.memory\8.0.1 - under its \lib directories for each target framework - it only contained .xml files, not any .dll files.

I deleted the package, cleared http cache, and ran restore again. This time the complete package was installed including dll files. My compiler woes went away.

I am curious to know how I may have ended up with a corrupt package (coincidentally just missing ".dll" files), and how come VS / dotnet restore isn't checking package integrity of referenced packages and giving meaningful errors about that - or perhaps I can turn that on somehow?

Verbose Logs

@kartheekp-ms
Copy link
Contributor

I just spend a few hours wondering why my code wouldn't compile after a package was updated

I created a simple console application and added a package reference to the Microsoft.Extensions.Caching.Memory package (version 7.0.0) using the dotnet add package command. Then, I used the same command to update the version to 9.0.0 and did not encounter the issue where package files were deleted.

We are tracking a related issue internally and it is marked as priority 3 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants