using upgrade-assistant to migrate existing xamarin forms project to maui #11651
Replies: 2 comments 2 replies
-
I have tried the upgrade-assistant for MAUI in the September. However, I cannot see any commits relevant to MAUI from that time so I assume that probably not much changed from that time. I will share my experience: The upgrade did not worked first. The assistant reported that the migration was successful but no files were modified. I have reported this (dotnet/upgrade-assistant#1265) and it turned out that the stable version of the assistant does not support MAUI at all and that you have to install the development version instead (yes, months after GA and after several videos were released demonstrating how the assistant can be used for MAUI - none of them mentioned that the stable version cannot do it). Once I installed the development version of the assistant, the migration kind of worked. It changed at least the namespaces in the .cs files. Some UWP platform code that was not compatible with WinUI was commented out and another comment with the recommended approach for WinUI was added. This was actually helpful. However, no other useful changes were made. There were a lot of changes that I needed to do manually such as changing namespaces in all .XAML files (only namespaces in .cs files were changed by the assistant). MAUI also contains some breaking name changes compared to Xamarin.Forms (Color->Colors, SetOnAppTheme->SetAppTheme, OSAppTheme->AppTheme) that I needed to do manually. These were however simple find-and-replace changes that can be automated. To wrap it up - migration-assistant helps a bit but still a lot of manual work is required. This work was not worth it because I subsequently realized that MAUI is unusable because it has so many bugs. I finally stayed with the original Xamarin.Forms version. Another problem that I was not able to solve completely is the incompatibility between UWP and WinUI. Some original code does not compile. Some code compile but it crushes on runtime instead. I have found out that there are much fewer samples and documentations for WinUI than for UWP. I recommend not rushing with the migration especially if you need to support Windows (where the migration can be very difficult if you use a lot of platform specific code). I am also interested if upgrade-assistant for MAUI is worked on. Looking at the list of commits, it does not seem there has been much progress recently. |
Beta Was this translation helpful? Give feedback.
-
@andreasbrostencab Did you ever get anywhere with this? I'm starting to look into it for some of our projects that are IOS ,Android And UWP. If UWP is not supported in the tool is there documentation for how to migrate it? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It's been around 6 months since .net maui was released (GA).
I'm a bit surprised that the migration path for existing xamarin forms project is still in preview
https://github.com/dotnet/maui/wiki/Migrating-from-Xamarin.Forms-(Preview)
Also including things like "Please note these steps might change as we get closer to GA".
"UWP projects not supported". Are they not??
Is the migrations document and the upgrade-assistant (for forms/maui) at all being worked with?
Should I wait with migrating my existing forms app (rather big, with android, ios and uwp projects) until the tools and documentation get better?
Beta Was this translation helpful? Give feedback.
All reactions