Updating Namespaces and Type References

Learn how to update Xamarin.Forms namespaces to make them work with .NET MAUI.

When migrating a Xamarin.Forms project to .NET MAUI, we can keep most XAML unmodified because the elements used by MAUI are almost identical to Xamarin.Forms XAML elements. However, we must change the namespaces in the code-behind files since those are very different in .NET MAUI.

In this lesson, we'll cover the process of updating namespaces in Xamarin.Forms code to make the code compatible with .NET MAUI. We'll use the following setup as an example. In this setup, the projects contained within the XamarinAppDemo folder represent the original Xamarin.Forms application. The project inside the MauiConversionDemo folder is a functionally identical MAUI project that demonstrates what the Xamarin.Forms project will look like after the conversion.

Get hands-on with 1400+ tech skills courses.