Is UseMauiCompatibility needed in Net9

Derek 0 Reputation points
2024-12-17T16:55:57.0766667+00:00

When I upgraded from .Net8 to .Net9 my Hot Restart stopped working and the app would crash after it displayed the splash screen. When I added the line ".UseMauiCompatibility()" in the MauiProgram.cs the app would then load without crashing.

Just want to confirm if this is needed in Net9 being I had no problem in Net8? This crash happens on iOS only.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,777 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 68,876 Reputation points
    2024-12-17T18:47:43.5966667+00:00

    the UseMauiCompatibility() is to make Maui code compatible with old Xamarin Form renderers and handlers. Until you port the old code (or update the nuget package that requires it) you will need it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.