-
Notifications
You must be signed in to change notification settings - Fork 258
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
PM UI: Consolidate or Update packages operations should not be blocked due to errors (Package Downgrade, etc.) #9224
Comments
Hey @bondarenkod
Am I interpreting this correctly to mean |
One more example. Packages in the current example:
The initial state of the Consolidate NuGet Packages window: Detailed view for the PI.XamarinForms.Core package: Let’s move to update window: I also tried to update Microsoft.AppCenter.* packages: The result the same, but now you can see more errors related to the PI.XamarinForms.Core package: It looks like when the NuGet tries to update packages it sees other packages downgrade status and it's kind of blocker for the current update process - circular dependency. I have no auto workarounds for this except the only one - manually change the package version in the *.csproj file. @nkolev92 thank you for your response! Yep, something like that. I think the NuGet should just do update and ignore some types of errors - e.g. 'detected package downgrade'. |
Hey @bondarenkod. So based on what you are describing, I think it's similar to #6010. Can you try to manually update all package versions on disk and run a restore? |
Merged the fix this morning. |
Please read the following information before posting the issue.
Details about Problem
NuGet product used: VS UI
NuGet package manager: 5.4.0
VS version: VS 16.4.5
OS version: win10 (18363.657):
Worked before?: NO
Detailed repro steps so we can see the same problem
Solution with multiple projects. Some of the projects included different versions of some packages. Some projects are referenced by others. For example PkgA(1.0, 1.1), PkgB(2.0, 2.1), PkgC(3.0, 3.1).
I want to consolidate or update versions of these packages to the latest (or single) one. But while I'm trying to do any of these actions, the process usually stopped by the next two errors:
But it's exactly I want to do - update all these packages!
Other suggested things
I think the update or consolidate process should be fixed, and all these errors should be ignored during these operations. It should do what I want and warn\show errors after all.
Also, I can probably suppress these errors by adding NU1107, NU1605 to NO_WARN section, but I don't want to leave these suppressions there forever.
Verbose Logs
no logs
Sample Project
I don't have the sample project now, I can't share the private project, I will try to create an example later.
#8982
Fix details: In PMUI downgrade or consolidate.
Currently Nu1605 single largest cause of nuget install to fail according to below graph, after this fix is pushed this will drop very significantly, I expect it'll go down on-par to NU1202, even less than NU1202.
For example in you have large solution with package reference style projects which are referencing each other.
ConsoleApp2(grandparent)=> ConsoleApp1(parent)=>MainApplication(child)
Now if you downgrade children and parent same time to same version or consolidate many different versions into same not highest version then it throws Nu1605 error. But still downgrade one bottom child, but not others. To finish it you have to repeat this action one by one.
Downgrade error Nu1605 demo (gif animation):
Consolidate error Nu1605 demo (gif animation):
If you 30 projects and they have different versions of same package then you may need to try up to 30 times to downgrade or consolidate all of them.
With my change only 1 time try it will succeed if input are good or fail depending if input are not good.
Now we're doing smart restore let children restore first then cache needed restore result in memory, next we restore parent and parent's of parent in target group in correct order so it wouldn't fail.
Current change doesn't change this current behavior: If you only select child ( without selecting parent too) and update to higher version than parent then it'll succeed, but wouldn't build code later.
Also good thing is it doesn't update half of solution and create any undesirable state. This change will help with my next fix #6010 to make it more deterministic and instead of bubbling many times of repeated restore only 1 time pass will work.
Please review @nkolev92 @zivkan @rrelyea, I tried to make as minimal surgical change without affecting other logics, for that one I took time to understand how whole process works. Here is my PR#3553.
Downgrade works demo after change (gif animation):
Consolidate works demo after change (gif animation):
:
The text was updated successfully, but these errors were encountered: