Cannot upgrade Xamarin to MAUI - VS 2022 for Mac #16701
Replies: 6 comments
-
Hi There would be a Mac version of the upgrade assisted that you run from command line if I remember correct. You can use this to get all the namespaces correct before you start moving code. I used visual studio code to fix namespace changes with find and replace. I would move small part of code and build so you don’t spend all days to try figure out build errors. look in the build log not the error window where it’s shows errors that is not the root issue. |
Beta Was this translation helpful? Give feedback.
-
Hi @JoacimWall , First of all thank you for your reply! Very much appreciated.
Yes, the upgrade assistant is the one I referenced in my opening post, but it does not work because it asks for the workloads to be installed even though they are.
Thanks, I have just started the procedure and I am doing as you say. I am a bit worried and dissatisfied with the upgrading procedure though, which at this point is more of a migration than an upgrade if you will... due to the breaking changes with quite a lot of "old" NuGet packages and such. Furthermore, one last question: since what .NET MAUI asks is basically a migration, is there a full list of what to change to be MAUI-style instead of Xamarin-style? You mentioned the single project solution (which is a great thing) and global usings. Thank you all! I keep this ticket open just in case anyone else wants to contribute, and/or help to fix the upgrade-assistant thing. |
Beta Was this translation helpful? Give feedback.
-
Hi
Regarding Nugets Most of the nugets that I use has bin updated to DotNet 6 and works for me. Those that was not I have bin able to replace for others. It's way too much work to fix nugets and migrate at the same time. If there is something specific nuget that you can't live without, you can email [email protected] and maybe they will help you. Another important question regarding this is that Msoft prioritizes fixing most of the bugs in Net 8 which will come in November, so if you need to have a version in production before then and can't use preview, I would wait as I think there are too many problems with Net 7 and that it is not prioritized by Msoft. We have a smaller app that we will release with version 7. But also a bigger app that we will wait to release until 8 is ready. So right now we have to code two versions of the bigger app one which is Xamarin and one MAUI this probably creates an additional cost of around 25%. //Joacim |
Beta Was this translation helpful? Give feedback.
-
In addition to the other comments... We shipped a new .NET Upgrade Assistant this week, including a fixed macOS CLI version if you want to go back and try that. In any case, almost never with the output of the assistant leave you in a state to compile successfully. That's the manual steps. The recommended approach above to create a new project and copy over your code is great. Many devs have good success doing that. I also recommend not adopting new .NET MAUI concepts at first unless you have a really compelling reason. Get your code over and building first. Taking on too much change at once can really slow your progress if not kill it. Copy all your platform specific stuff like app icons, splash screens, images, etc into the Platforms folders and then later you can adopt the MauiImage and other new conveniences. Docs have the most information here: https://learn.microsoft.com/en-us/dotnet/maui/migration/
Some libraries have been abandoned so I'd recommend replacing them with something that is actively maintained. Or takeover the repos and add the net6-* and newer TFMs and implementations where necessary. Reminder, as any gets stuck or have an urgent question, please email us at [email protected]. |
Beta Was this translation helpful? Give feedback.
-
Hi @davidortinau , thanks for your insight. I launched the upgrade assistant three times (Android, iOS and Forms projects respectively) making an in-place upgrade (no errors there). But when I open the solution I get the aforementioned missing workloads errors:
and VS is asking to install the workloads, which if I do and restart VS, it keeps asking the workloads to be installed again and I cannot get out of the loop. I must be doing something wrong. I do expect the migration to have manual steps (as explained in the migration guides you linked) but I expect the VS solution to "work" properly in the new MAUI way and to detect the properly installed workloads to the least. May I ask you, given a non-trivial Xamarin.Forms app project, what you would do to have it migrated to .NET MAUI with the Upgrade Assistant once you -in MacOS from a terminal- have changed directory to the .sln file location and run Thank you in advance. |
Beta Was this translation helpful? Give feedback.
-
@jamesmontemagno to the rescue: https://www.youtube.com/watch?v=7EaHKGUCIqc , this might help. Let's give it a try, at least now we know how the upgrade assistant is supposed to be used. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hi everyone, I guess I am in the wrong github but I do not know where else to ask for help.
Has anyone else upgraded anything else than a Xamarin sample project (I am not even able to do that actually) to .NET MAUI successfully on MacOS?
Any help would be appreciated. I also tried upgrading the project on Windows and bring it back to MacOS: dotnet/upgrade-assistant#1502
My currently installed workloads are:
Steps to Reproduce
Not able to use the upgrade assistant on MacOS. Upgrading on Windows does not generate a working project (besides the manual operations needed) and bringing it back to MacOS the project does not open correctly on VS for Mac because of missing workloads (even thought they are installed)
Link to public reproduction project repository
none
Version with bug
Unknown/Other
Last version that worked well
Unknown/Other
Affected platforms
I was not able test on other platforms
Affected platform versions
none
Did you find any workaround?
No response
Relevant log output
No response
Beta Was this translation helpful? Give feedback.
All reactions