Xamarin to MAUI: When setting <UseMaui>true</UseMaui> in csproj, my xaml.cs files are removed

Franklin 6 Reputation points

Within the csproj file, when setting the tag <UseMaui>true</UseMaui>, all xaml.cs files that were used with Xamarin are removed. When setting <UseMaui>false</UseMaui> all xaml.cs files are returned.

This happens when using the upgrade assistant or doing the migration manually.

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
1,420 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,190 questions
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
643 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 36,026 Reputation points

    MAUI runs on the .net 6 or net 7 runtime. Xamarin forms run on a custom mono runtime. So a particular app needs to be one or the other. You can not use Xarmarin forms with a Maui app, they must be upgraded to Maui forms.

    0 comments No comments