What to do when have many interdependent Nuget package updates to do but update fails when you initiate bulk update in VS Nuget Package Manager UI.

Using and generating Nuget packages has been discussed on this blog site here

Recently was updating an app with multiple interdependent Nuget packages. When in the Nuget PM UI 15 updates where detected and teh updates where initiated together. Errors NU1603 and NU1301 occurred aborting all updates.

Severity	Code	Description	Project	File	Line	Suppression State
Error	NU1605	Detected package downgrade Reference the package directly from the project to select a different version. 
 MyApp-> Twilio.AspNet.Core 5.77.0 -> Twilio (>= 5.77.0) 
 MyApp-> Twilio (>= 5.75.3)	MyApp	C:\Users\dwj\source\repos\MyApp\MyApp.csproj	1

The NU1605 error message

Severity	Code	Description	Project	File	Line	Suppression State
Error	NU1301	Unable to load the service index for source
 https://nugetized.blob.core.windows.net/live-reload/index.json.	MyApp	C:\Users\dwj\source\repos\MyApp\MyApp.csproj	1	

The NU1301 error message


I have multiple sources for Nuget updates:

These were all turned on. I tried turning off some sources but that didn’t solve things so I turned off off all bar the Nuget one. This enabled some progress but still had issues.

Note that turning a source off didn’t delete it so it can be re-enabled when needed.

The next thing I tried was just doing one update at a time. Whilst this did not initially solve things, when a failure occurred it pointed to a dependency that needed update so I tried updating that first. This was a bit recursive but eventually I got a single package that was updated. I then when to the immediately previous update attempt and redid that. Baring any further dependencies (which if required were similarly drilled into) that was updated. This recursive approach continued with all updates until finally all 15 updates were implemented.

The Take Home

I started these updates because I need to upgrade from Entity Framework 6 to version 7. I also upgraded from .Net 6 to 7.

The lesson here is to regularly do Nuget updates!

  Next: > Club Record Certificate
<  Prev:   Entity Framework Group Summing
 This Category Links 
Category:Coding Index:Coding
<  Prev: