-
Notifications
You must be signed in to change notification settings - Fork 255
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
Feature request - Option to update user global packages folder automatically after successful pack #9891
Comments
NuGet is designed around unique version numbers, so trying to avoid that may prove difficult. My initial thought here is to consider using Pre-Release version numbers for your Project B packages until releasing them. This would work without using pre-release versions, but if you're wanting to avoid generating many "official" version numbers, it's worth considering. @zkat may have more specific guidance. |
You may also want to review, comment and/or upvote this issue: #6579 |
I think version numbers is not a problem here, unless I am missing something. After the successful pack, it would delete the package in the cache if the same version already exists and then add the new package to the cache. Version number would come from the project, parameter, etc. as usual. Using pre-release doesn't seem the right solution, as I am not releasing to anyone else, it's for my own testing, just that the testings are happening in other solutions. It would also increase the build time as the package has to be copied to and from the local feed in addition to the cache after every change. I also commented and upvoted in the issue: #6579. Looks like we're trying to solve the same problem. |
There's a slight correctness challenge with just replacing the package content in the global packages folder is that restore need to run again. In particular, a restore for a given project needs 2 things from a package:
The file list is used for compatibility selection, and the file list is used to generate the references that'll be provided to the compiler. Now, the next logical argument is, how often would this happen? Finally, the global packages folder can be controlled on a project level too. |
@nkolev92 could you give an example of incompat scenario? We've been running this for a long time and haven't seen any issue, or maybe we have but we don't know. |
Nice work. Keep it up |
|
Closing as duplicate of #6579 |
I have been spending the last couple days trying to figure this out. I did something like this to achieve a similar effect.
If anyone knows a more elegant way to handle this, I'm all ears. Changing version numbers each time just for local development is just silly. semver is great and everything but we shouldn't be forced to adhere to it just for the sake of purity because doing so results in dirty hacks or workarounds. I think #7092 is related. |
Hi @thesushil @itsmedeep @nickhoeferpickpro , I’ve faced similar issues in the past when working with NuGet packages. As I mentioned #6579 (comment), I created a tool to address these problems. Feel free to check it out—I’d love to hear your feedback! |
NuGet product used: NuGet.exe | VS UI
NuGet version 5.6.0.6591
VS version 16.6.3
OS version Windows Server 2019
Setup 2 solutions each with a project so that one project has a package reference to the other. Project A depends on Project B via nuget package reference. Set GeneratePackageOnBuild to true in Project B.
Make changes to project B and build it.
Then go back to Project A and rebuild it. The previous change in project B is not reflected in project A.
Expectation: The change in project B should reflect in project A so I can test it and finally check in.
Suggested feature:
When the nupkg is generated for project B after successful build, it should (optionally) update the nuget user cache as well, overwriting if the same version already exists.
Local package source option doesn't work either as it would require increasing version every time project B is changed. If version is not increased it would use the older code of the same version from the nuget cache. After the successful testing, I would normally check in and the package version would be increased.
Keeping both projects in the same solution is also not a good idea, as that would mean all the projects referencing project B should be in the same solution as B which defeats the purpose of nuget reference.
Workaround:
We ended up implementing a custom target that deletes the package in the nuget cache and updates it with the newly built pack. It would be nice to have this feature built in.
The text was updated successfully, but these errors were encountered: