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

VS Rebuild doesn't reinstall changed packages into global-packages (In last version 16.8.0 preview 3.1) #10060

Closed
Denis535 opened this issue Sep 22, 2020 · 6 comments
Assignees
Labels
Functionality:Restore Product:VS.Client Resolution:Duplicate This issue appears to be a Duplicate of another issue WaitingForCustomer Applied when a NuGet triage person needs more info from the OP

Comments

@Denis535
Copy link

Denis535 commented Sep 22, 2020

I have solution with 2 projects.
First project produces nuget package into local repository.
Second project consumes this package.
I had to rebuild the project for the modified package to be reinstalled into global-packages.

But today I've updated Visual Studio to version 16.8.0 preview 3.1. And now rebuild doesn't reinstall the modified package. I'm forced to clear global-packages manually.

@Denis535 Denis535 changed the title VS Rebuild doesn't update deprecated package cache VS Rebuild doesn't reinstall modified package into global-packages (In last version 16.8.0 preview 3.1) Sep 24, 2020
@Denis535 Denis535 changed the title VS Rebuild doesn't reinstall modified package into global-packages (In last version 16.8.0 preview 3.1) VS Rebuild doesn't reinstall changed packages into global-packages (In last version 16.8.0 preview 3.1) Sep 24, 2020
@nkolev92
Copy link
Member

@Denis535

Afaik, this behavior is consistent. NuGet never reinstalls packages in the global packages folder.

How does the second project consume the first one?

@nkolev92 nkolev92 added Functionality:Restore Product:VS.Client WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Sep 25, 2020
@Denis535
Copy link
Author

Denis535 commented Sep 25, 2020

@nkolev92
Here is example.
NuGetLibrary.zip

Create "Local" source (I use path C:\NuGet\Repository).
Pack "NuGetLibrary" project. My "Push" target will push it into local source.
Rebuild "NuGetLibrary.Console". If global-packages already has an old package then "NuGetLibrary.Console" will use this old
package. In previous VS I haven't this problem!!!

Also be careful, nuget may install package from nuget.org. It's not my package!!!

@nkolev92
Copy link
Member

@Denis535

NuGet wouldn't replace a correctly installed package.

What you are describing is the expected behavior in both 16.7 and 16.8.

I think this doc well describes the NuGet installation process: https://docs.microsoft.com/en-us/nuget/concepts/package-installation-process

Do you still have 16.7 on your machine?

If you are seeing anything similar to what your describing with the old version, I'd love to help understnad the behavior.

@Denis535
Copy link
Author

Denis535 commented Oct 1, 2020

You know better.

The difference between build and rebuild:

  • Build: Compiles code files (DLL and EXE) which are changed.
  • Rebuild: Deletes all compiled files and compiles them again irrespective if the code has changed or not.

So, probably rebuild should not do something with packages. At least it will be faster.
But sometimes it can lead to problems. So, I would prefer that rebuild does reinstall packages.

@nkolev92
Copy link
Member

nkolev92 commented Oct 2, 2020

We appreciate the feedback @Denis535.

The restore that NuGet tends to run in VS is designed to be as seamless as possible, and while there is a slight difference between build and rebuild restores right now, see #6987, I'm not confident hiding an aggressive and expensive action such as package reinstallation behind rebuild is the best approach at this point.

I think among #6987 and #6579, I hope your problem is captured.

Closing as dup #6579.

@nkolev92 nkolev92 closed this as completed Oct 2, 2020
@nkolev92 nkolev92 added the Resolution:Duplicate This issue appears to be a Duplicate of another issue label Oct 2, 2020
@gioce90
Copy link

gioce90 commented Dec 30, 2024

Hi @Denis535 . I've faced your same problem. To avoid to be forced to clear global-packages manually, I recently make my solution public by releasing a package called NuJet (https://github.com/gioce90/NuJet). It enhances the inner-loop development and testing process for NuGet packages, especially in local workflows.

Feel free to check it out—I’d love to hear your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Restore Product:VS.Client Resolution:Duplicate This issue appears to be a Duplicate of another issue WaitingForCustomer Applied when a NuGet triage person needs more info from the OP
Projects
None yet
Development

No branches or pull requests

3 participants