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

Store only nuspec instead of whole nupkg in package install folder #556

Closed
igor84 opened this issue Aug 15, 2023 · 1 comment · Fixed by #570
Closed

Store only nuspec instead of whole nupkg in package install folder #556

igor84 opened this issue Aug 15, 2023 · 1 comment · Fixed by #570
Assignees

Comments

@igor84
Copy link
Collaborator

igor84 commented Aug 15, 2023

Currently when a package is installed its nupkg file is downloaded to nuget cache folder and also copied to the folder in the project where it is decompressed. This file is then used in NugetHelper.UpdateInstalledPackages() method where we call NugetPackage.FromNupkgFile to get info on the installed package but this method also checks if nuspec file exists instead to read info about installed package from it. On the other hand CheckForUnnecessaryPackages() method is skipping all folders that don't contain nupkg files and I as far as I see it should also not skip folders that contain nuspec files.

Anyway this means that whenever UpdateInstalledPackages is called it has to decompress the nuspec file from nupkg of each installed package and there is no other reason for nupkg to exist. That is why I propose we store just the nuspec file and not the whole nupkg in installed package folder making reading nuspecs much faster.

@popara96
Copy link
Collaborator

Note: two tests seem to be failing with the error InvalidDataException: End of Central Directory record could not be found.. They are both related to protobuf-net.2.0.0.668 package, and I am probably missing something here and am not sure why it is unable to unzip this package now, since it's downloaded to cache the same way as before. Newer versions of this package don't have this issue when manually installing (I tried with 3.2.26).

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