Migrating real life Xamarin project to .NET 8 MAUI | Matiki

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone so as promised I will try to update today my or upgrade my examine application to the latest version of net Maui which at the moment is net 8 and I already prepare a couple of tabs um to show you uh what is new in the net Maui so if you haven't checked those links you know you can just Google it out it's it's not a nuclear science and uh you can see also some metrics some numbers uh apparently they they really do a lot of pull request merges they resolve a lot of bugs um compared to Net 7 but as you might know I was not quite happy with the with the previous versions of doet Maui because it had so many bugs that it was impossible to work with it that's the reason why I have my app written in xammer um so the latest version of the of the Maui is 8.03 um supports iOS 17 Android 14 that's the most important and it has certain highlights here you can of course uh run through them uh but what I really wanted to uh go is is really maybe U you know show the app and really really try to migrated it because I still haven't haven't done it um even when we migrate the app if this is successful um there's still I'm I'm still a bit I have my reservation about the the de itself because at the moment there is almost 3,000 uh open issues maybe some of them are not right maybe some of them are you know um user issues user mistakes but uh you know the only way to realize is this the case or not is by you know trying it out so I did my homework I even created a specific Android emulator um for net Maui so as as as I installed this net um eight version and install the latest Maui there uh something happened with emulators as well so I had to disable and enable hyperv so that uh Android emulator is working as expected so as you may see here I do have certain animations uh I can uh change the languages this should work fine I can uh do a bit of a matth so let me just click around it oops I was too quick okay and see here I will I will get also uh certain animation this is ly animation and I'm not expecting it to work same as I'm not expecting that uh some packages are going to be functional for instance um the admob package as well as uh what else what else um as well as the uh the one to play the music because I also have the music in the background however let's let's start with the process so the version of the visual studio uh which I have is 1.8.3 so it should be uh correct so we can work with it uh the latest one latest and greatest at least today and today is December 10th so yes maybe it could be very good idea to create even a first new net Mai app the empty one just to see is it going to work and I'm going to create it I'm going to call it brand new Maui and I'm going to choose net 8 click create and I'm wondering is this going to work as expected so I'm going to create it as a as a start a project and uh maybe change to Android emulators my new pixel for M great so I'm going inside this very much open open heart and open-minded and let's see how does It Go um I think I already saw invalid file name it must contain okay uh this is a font this is a font okay so already even the brand new uh doesn't seem to work quite well but let's let's try so I'm just going to try to build this so maybe it won't recognize the font now if I if I missed the the minus if it's used somewhere in a code but uh let's see will it build it w so invalid splash splash okay um okay resources what is here a splash it's there what is his configuration Android resource okay shouldn't it be Maui resource let me just see not editor it would be very good to have this alphabetically the values uh Maui Maui Maui maiet right Maui it I guess that's it let's try to build again um and then let's see is it going to be any better looks a bit better and I think you always have this in a different way it should be Maui font ah Maui font very well and the other fellow is also going to be Maui font yes we're killing it awesome start of the migration up icon SVG uh where was it where was it uh debug resources up icon okay of course up icon SVG and you are as well Maui icon maybe yes and you as well I guess no this is SVG okay so this should hopefully work let built it takes a bit longer which means it is a bit more promising output come on Mr Mo so let's see will we have a chance yes build succeeded very well so if I play this now it should to deploy it to my emulator and we should see brand new Maui app without um without any customization without any any changes whatsoever so let me just include also my um Android emulator um just on a small note while this is building I'm going to try to upgrade this um this app of mine and of course first I'm going to try it on Android but also I'm going to try it of course on the iOS because the iOS uh was the very much problematic the last time so I'm quite interested in how will it look like hopefully we get deployment done soon and it's a blue screen hopefully not up death and we have a different icon here it's no longer the robot now it's a formula I guess and uh the concept is very much the same very well it works so this is uh proof that I have the latest version of the of the Maui great let us go to our Internet site again and here I already checked a couple of Articles you know upgrade uh from xamar to.net what to do um then I also realized that there is net Upgrade Assistant which can help us to do this um yeah um let's see let's see how is this going to work in general so again um I'm I'm very much open-minded I didn't try this very much so it's going to be also a bit of a bit of a surprise for me so let us go here so my assumption is as this is a a common uh project I guess this is somewhere something that I would probably want to try it out so I will play here uh I will have some upgrade thing yes I have an upgrade here let me do this um upgrades project and components and a copy project using transer great this this actually is what I want I don't want to do it in place so I want to do this one what is your update Target let's say new project um T core why not let's go on next and let's go of course with the latest and greatest soet 8 click next and I want to migrate all of those resources yes please I'm very curious how will it work with the with images that's that's going to be quite fun for me and I guess I will be able to get rid of some of libraries for instance newon so Jason because there is already out of the box serializer uh foret let's see this might be interesting I see a lot of green icons which usually is very nice five skipped okay 51 succeeded skipped okay MP3 font animations I guess this is this is what it skipped okay but um it did did the job I guess somehow let's see let me build a solution again there is a project here very well um okay so the target must be set to Windows SDK ER okay version will conflict okay so it seems that uh might need to check the project configuration a bit Ah but it still builds can I can and let me go to properties here because I'm I'm I'm not interested on the windows at the moment so iOS yes please um Android yes please windows I will skip the windows for now so let me just try to build this one once more okay uh install reference live data okay this does not look very much great the target platform has to Windows but when using Windows for or yeah but I'm not using them so what seems to be the problem okay uh so let me just see which packages are problematic as I expected yeah even the neutral adjacent is being marked okay very well so I will have to get rid of those I will have to clean this up first so can I just remove it like this I think it should be fine so remove remove I will have to adjust the code in a in a couple of places is so I have my animations I have my common let me just see okay of course here he cannot recognize it so he cannot uh figure this out so I should say Jason serializer do the serializer I should do something like this and now this should be working just you know this is is something that they should they could catch okay A bit of a code that I built okay so now I don't have one way controls application current properties so I have to figure out how to save the storage so he didn't um preferences set so he did actually use the preferences set okay so I don't actually need this one right if I got it write very well uh controls this is a custom code localization custom code Services sound yes there's going to be maybe a few things in the in the view model yes exactly so I don't want to have this I don't want to it's going to take a bit of a cleaning and I don't think this is going to be very much interesting uh interesting thing so I might just pause video and try to clean this up and then I will see will this Windows error going to get cleaned up or not so let me just try to clean this thing up and then I will let you know what I did okay so it seems that I was able to get uh more errors in the meanwhile um so I have no idea why I tried to build the build errors and uh I think like basic compilation areas in my code so I even commented out some code to be as as as fast as possible and um what it seems to me is that there are some additional issues um but I'm not sure which one um okay so let us let us go with the with the good old school approach comparing the new the functioning version against well the upgraded unfunctional version so am I is this really the case that's it build it again let's see is it the need better no okay so it's still bad okay so let's just try to compare it um so this one is telling me Target Frameworks I like it uh and then let's say that this conditions for the MS build I guess they are correct let's just copy these two guys here why not output type uh here is exit and there is output library but maybe this is not a problem okay let me just try to build this one to see will I throw will I get rid of any problems if I specify the Frameworks like this this looks less let's see something is less what else do we have here use Mai true single project implicit usings enable irrelevant application ID uh only thing here is output type seems to be exit here and then here I actually have Li so let me just oh let's cancel this little fellow and let me just build it again program does not contain static main methods suitable for an entry point of course um yeah this is becoming quite a fun so for quite simple project so far I'm not able to to do much and this is great I got rid of this Windows error somehow but now I just have this cannot resolve type and this could actually be problematic because of maybe linkers because it doesn't recognize anything here the only question is how to get rid of it and now we're going to consult our good old friend Google because I don't have clue what is this so C error X error xfc 0 z z0 z let try oh great cannot res type very well stack Overflow imagine I'm using this instead of CH GPT although I do have it uh okay converter in a class Library open solution okay steps to reproduce yes Linker he's removing our libr from new project this happens when the compil removed unus for a libraries it Happ that library is used but it's weird or I'm not sure is this really the case let's see what is this guy saying great please attach for okay so March 7 so it's it's relatively old thing and the B is already this this is the thing that I hate here this usually happens if exam for is also working in the project make sure to check all dependencies of exam forms you can verify this by adding snippet okay at the end of the project thank you Mr M Li B I definitely didn't pronounce this well so where he said at the end of your CS project like this the s from it let's see this project or dependency has imported samary informance packages net m is not compatible okay can you please tell me which the Marine fors packages that would be quite useful this is not very well and by the way where are my images ah okay I don't I didn't get any images because the images are are living in my Android package okay this sucks okay let me just try to upgrade maybe this one as well let me try to make more mess I'm curious what is this going to do update project newer no update project features Project without changing the hole and it's no I want to have this in place side by side upgrade I want I want I have a new project Tiki Android core yes let me just go of course with latest and greatest 8 and say upgrade selection I'm very curious what is this because to to be honest one of the biggest benefits of of Maui is that you get um this fancy new way of of managing resources because you spend a lot of time building all those images in different resolutions and hopefully net Maui can do it as well I have some assets like like a music for instance the pngs as you may see they're they're pngs I'm quite C curious how will it work with the with with the with the icons because in in um in Android it is a bit difficult to do this but now the question is where are my I have the resources now but now this is nothing this is just um an app I guess right so even if I build it version conflict detected where where are you detected okay install reference examing Andro but I shouldn't install this reference because it's examing directly exam Andre X life cycle why not um sumar Android was it Android uh suar in Android x x was it life cycle I think it was life cycle live data life cycle live data let's see this should be the guy I guess I guess this should be the guy what is going to be output of this I'm quite curious failed version conflicted some in Google Android okay H this kind of sucks because now and and let me just try something else so if I choose those two for instance can I then upgrade no it has to be a single select because the whole point of of of Maui as well is that we can have um our resources the the code and resources inside one one uh big Library which I'm going to continue on now and I'm just going to um unload this one and maybe I will also unload these guys as well just to speed up my my uh build process and why not also brand new Maui so if I if I don't have the resources the images of my iOS and uh and Android app how do I how do I migrate this build succeeded really and what do I get now I get I get uh what do I get now I I don't get anything because I don't have right I don't have it's it's a library so I need Exel right and now it's going to tell me again that okay improper project configuration no manifest specified okay of course it doesn't know how to start specified Android manifest file do not exist okay um this is interesting I did I didn't honestly expect that this is going to happen because my my assumption was that someone actually tried to do this in the past and maybe I'm doing it wrong I'm just going to make a pause of this video and uh I'm going to analyze this uh a bit but it definitely doesn't look as as simple as I was expecting maybe someone already have a tutorial how to do this I just try to do it uh tried to do it without any tutorial by making tutorial but um maybe this number here explains certain things that could be possible very well then let's make a pause okay and it seems to me that I was able uh to finally solve the issues that I had in the past so first thing that I made as a mistake is um the output type uh switching between exit and library is not really the thing uh we should we should really stick with the library because I just learned that uh the only thing that you can upgrade is this shared project so you cannot really upgrade uh the specific Android or iOS project because uh well you can't and this is a bit of a problem for me because uh usually what you will have in your project is you will have a lot of resources and you will have a lot of images uh and this is Especial complicated in the I because you will have also assets catalog and then this asset catalog will have a specific sizes of each of the icons or any image that you would like to use you might want to have it uh you know really really different sizes um it's it's also to be frank it's also complicated um in the Android because you can have of course drawable uh but you can also have uh the specific sizes uh depending uh images depending on the on the different sizes for instance the icon is is exactly like this because even in the icons in Android there there are multi-layer icon as you see here I have launcher background foreground and monochrome so you have all those things and I'm just wondering who would have to do this and my assumption is that I would have to do this manually because no one else is mentioning it differently but the good thing is the project builds that's that's the thing and the way how I solve it switched to library and then what I did I unloaded all of the all of the projects except the one that I that I upgraded this to core and then it just worked which is great and now uh what was what was quite uh interesting as well in in the other tutorial that I just watched from James Monto Magno I believe um he said you know you can now use this Library as a as a reference to your completely new net Mai project so as we already built the new net Mai project I can just uh reload this one this Brown new Maui I can just build it again and then I would be able to add reference uh to uh the the the converted project here but what he did as well he he just played around with uh with all of those uh things that he has and he moved them into the into the completely new project he just left I believe this this uh Maui program because he likes the the the fonts configuration here and things like that so I'm just going to do uh the exactly the same thing so I'm going to so it's house here build succeeded very well so I'm just going to uh mark this as a startup project I'm going to CH choose animations common controls fonts localization models Services sound view model even app assembly info let's I don't know I can go with this one as well uh and then I have few zemal and this one so the only thing is I don't have here app shell maybe I don't even need app shell but okay let me just uh move these guys into the brand new Moi so I'm going to just apply tool item I'm just going to replace all of them very well and now I would have to of course adjust the name space and uh what is the app shell here initialize component uh where are you used my little fellow right here of course up shell um yeah why not main page let's see this is a fly out but maybe I can even get rid of this right so maybe I can I can get rid of this but let me just try to build it first let me just try to build it first to see where do I stand build has started yeah this is um quite interesting because I have my Styles also applied in the app examl this should work completely fine although in the Mau I believe you can have your own separate uh file for specifying Styles and I think this is uh probably the way it was it was done but just out of a curiosity I'm just going to play this app and and see what do I get again I'll have absolutely no images because I haven't migrated images I would have to do this uh as well but I'm just curious what will it uh deploy and will it be able to deploy anything and let me just kill those warnings here living dangerously still running okay deploying something and here is the emulator I'm expecting that something is going to crash I'm just not sure in which capacity it still deploys okay something is happening and of course we are not able to use the dependency service no get current culture info so I guess ah because the this little guy is something that I used in both of the it's it's a platform specific so what I can just say it's going to be uh actually I will comment this out and I will just say here uh something like whatever um I I just wanted to to potentially start working so a lot of compromises already but uh that was expected let us see will it work bu started yeah it really takes some time to build at least you can fast forward and looking a bit better yeah I think it's going to be really pity if we cannot work uh quite well with with all the other things okay now Lo Iz ation is failing as well so what I will also do here I'm just going to say instead of saying this I'm going to say just return new localization model what do I have here sections new sections and that's it hopefully this is going to be better so obviously the application wants to localize uh certain elements right now which is is a good signal because it means it tries to render uh main page at least let's see let's see will it will it work as expected but really I will also try to move the images afterwards so it should be on resources images very well and then I would be able ideally to move all of my images to that folder and this should be or King and believe it or not seems that we are visually almost there animations are there very well let me just okay missing some spacing think some errors no compatible code index was out of range I have no idea but uh but okay hot reload uh let me just kill this I will think about this afterwards the only thing I want to do right now is I just want to take those resources uh no [Music] bunny I will just take all of those PNG f files hopefully this is everything yes I hope so I will say copy and we'll go to images here and say paste let me try again because I think the configuration of this guy is for the images to use um to use all the images right here and what oh come on please please oh kill me so I have to switch all of them to be Maui image or something Maui icon Maui can I go resource Maui image okay let me just copy this thing and then maybe just select all of them press F4 of course not so let me just do this enter I always wanted to do this it's such a beautiful thing to do exactly this come on please ha yes yes yes yes yes yes let's see did it apply yes he did great my new pixel for Maui let me start let me start and let me see is this working as expected I would be really happy if this goes and if I can see my app running with a Maui at least a bit deploying Dey oh man it's it's deploying so much okay great it should pop up right now Moment of Truth is it there yes it is there this is great it's missing the localization that is completely fine because I just deleted this this Json of the localization so the way how to actually retrieve it animations are still here the borders around frame are still here the text it looks even styled relatively correctly uh of course the this button has been cut let me just go to the change language this is a bit uh narrow in my opinion even if I switch the language here it will I hardcoded it to use uh to use the English one so let me just say up to 100 so this is of course 61 and then I get the exception in the background as you see also here the the frame on top is is not uh is not the best one but the good thing is that uh this did migration and um yeah the only question is how happy are you going to be with it because I think the the complexity of the migration is going to vary very much on the complexity of your app and complexity of your dependencies so here I went to the bare minimum I commented out everything I could comment out I remove all the all the dependencies that I could have and uh yeah this is the result so as you may see uh there are some styling not applied correctly I'm getting some exceptions of course um but it does look more or less um working now this might migration Wizard or however it's being called seems to me more like a glorify glorified um namespace uh renamer maybe it will find thing or to that are obsolete uh that needs to be changed but if you're a good developer anyways you would probably have your wrappers around um I don't know the ways how you can access preferences or things like that so ideally you would be a able just to copy paste all of your resources and just rename them as you go in brand new Maui project I think this is going to give you much less headaches than doing it with the with the with this uh with this migration utility at least at the moment you will have ability to control a bit more things but um yeah the reality is that this this does something um and um yeah the thing that concerns me a bit is the fact that there are some exceptions happening uh even in my C code which shouldn't usually happen but uh yeah it could be that there are some changes there as well so you'll probably need to do also a bit of a regression testing of your app yeah it's it's not going to be such an easy thing um I think to migrate things to to to Maui up uh no matter what anyone tells you so after analyzing migration assistant I my conclusion is is is quite simple I think the the the biggest key is in the name so it is an assistant it just assists you to migrate things it doesn't actually do the job well at least it doesn't completely do the job so I would say that this is you know quite politically correct naming of it although the marketing of this assistant is that you know it does almost everything for you but if you watch the video of James Monto Magno he's himself is saying that you you know you should get rid of the pendency injection you should update your mvvm code you should think about icons Splash screens you should uh consider you know migrating also images that you have your pgs to svgs um this is remarkable a lot of work for the thing that is called Simple migration it's it's everything but simple migration if you're working with a complex app you will probably have hundreds of images in your uh in in your uh common project I I just don't understand how someone would expect that we would have to migrate all of them to the svgs just so that we can introduce them uh to Maui this is just uh it's not um financially viable in in majority of the cases so I'm a bit concerned that it was not even thought of in in Maui that you can have this backwards compatibility that you can also just you know what I was really really expecting and this is you know uh this was my expectation that I can just maybe select all of those projects these three guys and I can say okay uh convert this to the Maui application and that this uh migration wizard however assistant would be smart enough to recognize my code to understand the differences between Maui and xamarin for instance if I click play here that he adjusts my styling you know to to be as it was before maybe I was asking too much could be possible but of course as you may see the rendering of this uh of this uh uh counter is completely different uh than it is uh in my application I will try to start it again just so that you can see the difference um yeah it's um it's just it's just a bit weird so um I would expect that it really moves the images uh on its own I would at least expect that um you know have option in your wizard saying do you want to build a library which you can reference to your Mai project or do you want to build executable that would be something at least um and I'm not I I hope that I'm not repeating myself but this is one of the simplest migration scenarios so I commented out all the fancy thing that I had like dependencies on on on the packages to play the music or to do the animation or things like that because if if you if you pay attention here you see the for instance the the heartbeat of this Frame here is completely different than the one in the Maui um the the the rounding here on the corners is completely different and of course this one works uh in the other one it doesn't work even if I did micr it so I'm I'm a bit pessimistic about it uh to be honest and I'm I'm really not sure what is true benefit of it I think it would actually make more sense to start completely new uh Maui project and if you want to go on a Maui of course and do one page by Page One view model by view model and do it on your own because at the end of the day you don't need any migration assistant to change the namespaces or to copy files you can use notep Plus+ to do this that's it um but yeah anyways I I don't want to be uh I don't want to be too pessimistic because I think there is still uh progress there since last time I was reviewing the last version of Mai I'm not sure was the doet 7 but uh there are some positive movements here however what concerns again is the number of bucks because uh as you may see I'm actually recording this video for for some time already because uh it actually took much longer than I was expecting and uh 18 minutes ago 19 minutes ago 45 minutes ago 1 hour ago of course those bugs are going to go through the triage and they're not the focus of this video of course but it's just something that I want to ask myself you know do you want to use the the migration assistant to migrate to something which has almost 3,000 open issues is this is this good um I I'm not sure I know that Microsoft has amazing Engineers who can solve these problems so it should be possible the only question is you know of course uh do they have capacity to do so um what I think it's not good is that Microsoft is telling us hey guys you know what you have five more months to support for zarine and at the same time m is not stable enough so at least what I think they should do is they should extend the support of zarine until Maui is stable enough until I get H I don't know at least similar rendering of the things uh that I did here and I I I didn't even do this on my iOS because I thought it doesn't make any sense um and now when I'm thinking it I might even try I might actually do it do it uh as well for the end also on the iOS just to see how does it work on my uh iOS emulator and then I'm going to close this but anyways I think um it it there there is a progress but um I would expect much more uh based on on the marketing that was provided to us thank you very much and yeah uh let's see how the iOS version looks like so it seems that I was able also to run the app uh inside the uh iOS inside the emulator although it is a bit weird because there is this uh Bak black boxes on top and on the bottom of o I'm trying to move it with the wrong Mouse um I guess that this is some sort of a bug or I don't know what exactly because I'm using this uh property to use this um um safe areas in the iOS I don't know is this uh is this the cause the reason of it but this is how it looks like um yeah it is obviously a bit different than it is uh than it is in the in the U Android for instance you can already um recognize that displ button is a bit different so it's not it's not the same as it is um in the in the Android version so it's not being cut um yeah everything else more or less looks uh looks as I would expect of course when I click play button uh the UI is uh well not not as as beautiful now the frame is complete circle but uh all the frames here are kind of kind of fit uh all together as you may see the application crashed because um because of the uh the same problem with the view model okay I'm getting also a bit of a uh eror stack uh exception Stacks or yeah problem details in general but yes you may you may notice that um that at least it works yeah so that's it thank you very much and um yeah I wish you a pleasant migrations and work with net Maui
Info
Channel: sizeofeight
Views: 2,160
Rating: undefined out of 5
Keywords: .net 8, .NET Upgrade Assistant, Xamarin, migration, Maui stability, Cross Platform development, .NET MAUI, Cross-platform development, Mobile app development, Mobile app development with MAUI, XAMARIN, Xamarin review, Cross-platform app development with Xamarin, .NET framework, .NET MAUI UI customization, Cross-platform app development with .NET MAUI, NET MAUI Honest Review, NET MAUI Bugs, iOS development, .NET MAUI Demo, Xamarin Demo
Id: W7KwYMtuf7k
Channel Id: undefined
Length: 49min 3sec (2943 seconds)
Published: Wed Dec 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.