Search code examples
.netupgrade

Upgrading .net 7 to .net 8 using upgrade-assistant


I am trying to upgrade a .net 7 Maui project to .net 8. I tried both the cli and extension versions of the upgrade assistant. I've installed the .net 8 SDKs and runtimes. The upgrade assistant appears to make format changes to about 7 files. I couldn't see any substantial changes except formatting. When I try to run in debug mode, I get an error about needing to check the debug deploy box, but it's already checked. Are there any recommendations for doing this type of upgrade/code migration to .net 8? When I try to choose .net 8 in the properties for a target, it's not available. enter image description here enter image description here


Solution

  • I recently did a serious deep dive on using the .NET Upgrade Assistant. I can confidently say, "don't bother".

    It's a pretty good tool for small, simple apps but not so much for medium to large apps.

    It does very little aside from updating the CSPROJ file. It may fix up some dependencies or Nuget packages, but it will be wholly un-aware of any breaking changes. It does not analyze your code or refactor anything.

    You can see exactly what it will do for you here.

    Your mileage may vary, but on a small project it was straight forward. I did the upgrade, and then spent hours fixing all the issues like upgrading NuGet packages to the correct version and fixing up breaking changes.

    On a large app, the sheer amount of build errors due to breaking changes made this a non-starter solution. For large applications it would be better to work with a strangler pattern than to try and fix everything all at once.