Migrate to .NET MAUI from Xamarin.Forms Faster Than Ever - .NET Upgrade Assistant for Visual Studio

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ค. 2024
  • The time is now to start migrating, upgrading, and updating your Xamairn & Xamarin.Forms apps to .NET & .NET MAUI! It has also never been easier to make this transition thanks to the new .NET Upgrade Assistant built directly into Visual Studio 2022. I set out to give you a complete guide and walk-through of a real-world application from start to finish. This will cover custom fonts, NuGet packages, Xamarin.Essentials, Xamarin Community Toolkit, Images, and more! By the end of this video, you will be completely ready to start and finish your migration!
    Relevant Videos:
    • Learn .NET MAUI - Full...
    • Singleton vs Transient...
    • A Better Pub/Sub Messe...
    • .NET MAUI Tutorial for...
    • Accessing Native Platf...
    Links:
    Code: github.com/jamesmontemagno/My...
    .NET MAUI Docs: learn.microsoft.com/dotnet/maui/
    Migration Docs: learn.microsoft.com/dotnet/ma...
    .NET MAUI Dependency Injection: learn.microsoft.com/dotnet/ar...
    .NET Upgrade Assistant: dotnet.microsoft.com/en-us/pl...
    Blog on Upgrading Xamarin.iOS & Android to .NET: devblogs.microsoft.com/xamari...
    Join this channel to get access to perks:
    / @jamesmontemagno
    👕 Buy some swag! - jamesmontemagno.myspreadshop....
    ☕️ Buy me a coffee - www.buymeacoffee.com/jamesmon...
    Follow:
    👨‍💻 GitHub: github.com/jamesmontemagno
    🦜 Twitter: / jamesmontemagno
    📄 Website: www.montemagno.com
    📰 Newsletter: newsletter.montemagno.com/
    Chapters:
    00:00 - Intro
    01:00 - Migration Considerations for Xamarin.Forms
    03:00 - App & Code Walkthrough
    03:50 - Install & Use .NET Upgrade Assistant
    09:15 - Fixing Complication Errors (differences between Xamarin.Forms and .NET MAUI)
    12:45 - Merge code into new .NET MAUI Application
    19:00 - Fonts, Images, and other Resources
    23:30 - Platform Specific Code & Dependency Service/Injection
    28:08 - Documentation overview for Migration
    29:25 - Wrap-up and final thoughts
    Disclaimer: This channel, videos, and streams are created in my spare time and are a product of me... James Montemagno! They are NOT officially affiliated or endorsed by Microsoft (my employer) in any way. Opinions and views are my own.
    What is on my hat? It is the CLE clothing logo because I am from Cleveland! Checkout their awesome CLE merch: cleclothingco.myshopify.com/
    What is that art on my wall? It is an original piece from the French street artist Gregos of La Butte Montmartre: / bcez1onhiqx
    My Setup:
    📷 Canon M50 Mark II - amzn.to/3P8R7lp
    💡 Nanoleaf Elements Lights - amzn.to/3umwJVW
    🎙 Blue Spark Microphone - amzn.to/3qgtYkq
    🎙 Blue Pop Filter - amzn.to/3jEWM3r
    🤳 Rode Microphone Arm - amzn.to/2Z68AlE
    🎧 Sony MDR7306 Headphones - amzn.to/372jxta
    📲 Stream Deck - amzn.to/373Uk1n
    🖱 MX Master 2S Mouse - amzn.to/3d7J2gj
    ⌨️ Tecware Phantom Keyboard - amzn.to/3aUP4y9
    #dotnetmaui #xamarinforms #visualstudio #dotnet
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 61

  • @mimo5515
    @mimo5515 10 หลายเดือนก่อน +3

    Nice video for those who were using xamarin forms. Still no news on the InAppBilling video? 😮

  • @yaroslavpelyukh4763
    @yaroslavpelyukh4763 10 หลายเดือนก่อน +1

    Great video, James! Thanks for making such content - it makes our lives easier) BTW, just in case you will have a spare minute, it would be really great to hear your thoughts on the latest announcement of VS for mac retirement. How the development on mac will now look like? I do know lot of people that just bought the mac machines in order to able to develop mobile apps with xamarin/maui. Should they now switch to Rider as alternative?

    • @JamesMontemagno
      @JamesMontemagno  10 หลายเดือนก่อน +1

      I think the blog outlined it fairly well, but a move towards VS Code as the main go to is what I’ll be doing. Or you can use a Windows VM with VS or a Dev Box is another options. Or rider as well is a great option.

    • @jcubero001
      @jcubero001 8 หลายเดือนก่อน

      Rider

  • @timothydog76
    @timothydog76 10 หลายเดือนก่อน +9

    This video drops just in time as I finish up a month-long conversion of our Xamarin.Forms app to MAUI.😂It's been a ride! Not a very smooth one unfortunately.

    • @batcodes1690
      @batcodes1690 10 หลายเดือนก่อน +2

      Can you please share your experience and pain areas?

    • @divanvanzyl7545
      @divanvanzyl7545 10 หลายเดือนก่อน +2

      Please share your suggestions. Ive just started with the upgrade.

    • @timothydog76
      @timothydog76 10 หลายเดือนก่อน

      @@divanvanzyl7545 Before migrating evaluate all of your 3rd party libraries to see if they support MAUI. I eliminated a bunch of them with out-of-the-box features. Create a new MAUI app and migrate the code. It's the only way to do it that worked at all for me. Expect MANY build errors at first. I worked through at least 600 errors before the app would build (and that's with running the upgrade tool already). When it finally built then I got a slew of XAML parse errors before the app would run. If you have a lot of Xamarin.Forms custom renderers expect to spend a lot of time converting them to handlers/mappers. I ended up eliminating 90% of my custom renderers. Also expect to spend time tweaking the UI. For me a lot of the views looks different mainly because I had to switch to the new Border control from a 3rd party control we used in XF. That's all I can think of off the top of my head. I'm actually still working on the upgrade right now trying to figure out why the Mopups MAUI popup library looks broken in iOS but not Android. Maybe things will go smoother for you. Good luck!

    • @batcodes1690
      @batcodes1690 9 หลายเดือนก่อน

      @@divanvanzyl7545 I have also started migration. I have created seperate MAUI project and started copy pasting each code and resolving compile time issue.

    • @PeteMidg
      @PeteMidg 9 หลายเดือนก่อน

      Me too, my Xamarin forms project contains about 70 pages, sqlite, push notifications, old wcf service references, and is being tricky when it comes to getting the new 'Core' upgraded class library to build alongside the 'old' platform folders. One issue I'm getting when trying to pair to Mac concerns it claiming that there are duplicate manifest ID (16.4.8825-net8-rc1 for maccatalyst) that conflicts with the same ID but for iOS within the c:\program files\dotnet\sdk-manifests\8.0.100-rc1 folder. Baffled!

  • @Tommor81
    @Tommor81 10 หลายเดือนก่อน +2

    Hi James, great video thank you. Is Maui production ready? There are a lot of posts saying it is full of bugs. Is this true?

    • @Tommor81
      @Tommor81 10 หลายเดือนก่อน +1

      We got stuck on one of the first steps of the upgrade assistant and can't find any information on how to fix. The project template "maui application" doesn't exist. We have downloaded ".NET MAUI Project and Item Templates" closed the program and tried again. We are on the latest version of Visual Studio 2022. Any help anyone?

  • @MunkiiYebee
    @MunkiiYebee 9 หลายเดือนก่อน

    If we don't include iOS Android Targets and Unit Test projects our XF app sln has 16 projects. Can the Upgrade Assistant be asked to target them all at once? Do we manually upgrade each project from the bottom up?

  • @neil9363
    @neil9363 9 หลายเดือนก่อน

    Hi James. Are you aware that the app may run in the iOS simulator but won't build (i.e., archive for publishing)? MyMauiCoffeeApp/MyCoffeeApp.Shared/obj/project.assets.json' doesn't have a target for 'net7.0-ios'. I'm facing the same issue with an app we're migrating following the steps in this video. Even adding a blank .net standard class library project to an empty MAUI app results in a build error.

  • @AngeloLazzari
    @AngeloLazzari 2 วันที่ผ่านมา

    Good evening! Thank you for this great video!! We are trying to migrate our app to MAUI and we see that await Application.Current.SavePropertiesAsync(); is obsolete, do we have to user another thing or simply the Preferencies are saved automtically? THank you very much

  • @gregorymoore2877
    @gregorymoore2877 7 หลายเดือนก่อน

    I just ran the upgrade assistant on one of my projects. It appears to be mostly successful and did not give any errors related to the migration. However, it did not create a Platforms folder or any of its expected contents. Dotnet 8 is what I migrated to.

    • @sigma_z
      @sigma_z 11 วันที่ผ่านมา

      You need to create those separately. The migration tool only creates a library.

  • @dtcartoon
    @dtcartoon 10 หลายเดือนก่อน +1

    James - is MAUI in trouble? VS for Mac retiring really concerns me. I've poured a lot of time and resources into MAUI. It seems like a really small team, and Microsoft is being quiet about whether or not it's really committed to it.

    • @JamesMontemagno
      @JamesMontemagno  10 หลายเดือนก่อน +2

      .NET MAUI is full steam ahead. The team has a big push in .NET 8 and the new VS Code extension

  • @adilbangush5014
    @adilbangush5014 10 หลายเดือนก่อน

    Can you make one video in dotnet Maui android, that how we read OTP automatically.

  • @yoriichi28
    @yoriichi28 5 หลายเดือนก่อน

    Hello boss can you please make a video on Xamarin native to .Net MAUI

  • @SaveTheHedgehog
    @SaveTheHedgehog 8 หลายเดือนก่อน

    Do I need to upgrade my referenced xamarin forms nuget packages beforehand? To be compiled the main project?

    • @JamesMontemagno
      @JamesMontemagno  8 หลายเดือนก่อน +1

      When you upgrade they should be uninstalled automatically.

  • @arunrajramalingam2512
    @arunrajramalingam2512 9 หลายเดือนก่อน

    James, I am trying to convert my xamarin forms app to MAUI. I am trying to follow your video but when I select upgrade, the project template dropdown shows only "Empty project". I don't see "Maui application" like you show in your video

    • @JamesMontemagno
      @JamesMontemagno  9 หลายเดือนก่อน +1

      2 questions… do you have the latest version of upgrade assistant? Check extensions manager.
      Are you selecting the net standard shared code project?
      If still can’t do it, try the cli

  • @cruisingaddict9695
    @cruisingaddict9695 5 หลายเดือนก่อน +1

    We need an updated Admob package for Maui!

    • @JamesMontemagno
      @JamesMontemagno  5 หลายเดือนก่อน

      Should be updated - www.nuget.org/packages/Xamarin.GooglePlayServices.Ads

    • @JamesMontemagno
      @JamesMontemagno  5 หลายเดือนก่อน +1

      Not much has changed for integration, good post: startdebugging.net/2023/11/how-to-add-admob-to-your-maui-app/

  • @Tommor81
    @Tommor81 10 หลายเดือนก่อน

    James, or if anyone else can help. When we do this, the Project template “maui application” doesn’t exist. What are we doing wrong?

    • @souleymaneba9272
      @souleymaneba9272 9 หลายเดือนก่อน

      .NET MAUI itself was full of bugs when I tested it around Feb 2022. A simple label with multi-binding was crashing the app. After investigation it was a well old known bug, lol.
      At the time I thought that people saying to wait a couple of years was exagerating... I'd say that in 2026 MAUI XAML should be ready. But wait, Xamarin form end of support date is in may 2024, 😉.

  • @AnisaMzher-ru4zg
    @AnisaMzher-ru4zg 10 หลายเดือนก่อน

    Gif images not play animation android platform?

  • @gwisekor
    @gwisekor 10 หลายเดือนก่อน

    Do you not specify Android Version in Application>Android Targets> Target Android Framework?

    • @JamesMontemagno
      @JamesMontemagno  10 หลายเดือนก่อน +1

      It is specified in the csproj now for you.

  • @PratikSolanki88
    @PratikSolanki88 10 หลายเดือนก่อน +1

    Why can’t we upgrade XamarinAndroid and XamariniOS using the tool? I am asking it because I tried to upgrade it using the tool.

    • @JamesMontemagno
      @JamesMontemagno  10 หลายเดือนก่อน +2

      Moving from XA and XiOS is actually pretty easy just change the csproj for the most part. It is a simple migration as hardly any api changes. Take a look at the docs I linked to.

  • @RichaMaheshwari-ht4iu
    @RichaMaheshwari-ht4iu 3 หลายเดือนก่อน

    Hi @all if any project is complete in Xamarin project so is this mendatory to migrate in .net MAUI

  • @divanvanzyl7545
    @divanvanzyl7545 10 หลายเดือนก่อน

    I dont have an "Upgrade" option when right-clicking on my Xamarin.Forms .csproj file. How do I address this?

    • @JamesMontemagno
      @JamesMontemagno  10 หลายเดือนก่อน +1

      Did you install the upgrade assistant extension?

  • @doxpi64fr
    @doxpi64fr 10 หลายเดือนก่อน

    Is NET Upgrade Assistant going to be on visual studio 2022 for MAC ??

    • @JamesMontemagno
      @JamesMontemagno  10 หลายเดือนก่อน +2

      You can use the CLI on a Mac

    • @JamesMontemagno
      @JamesMontemagno  9 หลายเดือนก่อน +1

      .NET Upgrade Assistant on Mac and Linux?? #dotnetmaui #coding #visualstudio

  • @enricoroselino7557
    @enricoroselino7557 9 หลายเดือนก่อน

    is this working if using third party nuget ? like telerik for example

    • @JamesMontemagno
      @JamesMontemagno  9 หลายเดือนก่อน +1

      It wont know how to upgrade those specifically, so you will need to go and grab some the latest nugets from them.

  • @batcodes1690
    @batcodes1690 10 หลายเดือนก่อน +1

    How to do MAUI migration using MAC machine?

    • @JamesMontemagno
      @JamesMontemagno  10 หลายเดือนก่อน +2

      There is a CLI version of the tool available

  • @user-ve8wg7bz3s
    @user-ve8wg7bz3s 7 หลายเดือนก่อน

    Can your dependencies target .net 6 or 7 if your .net maui app targets .net 8?

  • @bitbull-ltd
    @bitbull-ltd หลายเดือนก่อน

    Ran it on the app I'm current working on and it's come up with > 150k errors! 😅And that's after I've already manually separated anything that's not a View into a shared library that's not reliant on Xamarin.Forms.

    • @JamesMontemagno
      @JamesMontemagno  หลายเดือนก่อน +1

      You got this!!!! 1 error at a time :)

  • @RichaMaheshwari-ht4iu
    @RichaMaheshwari-ht4iu 3 หลายเดือนก่อน

    Is there mendatory to migrate the Xamarin form into MAUI is any project is completed in Xamarin form please suggest me

    • @MilfH69
      @MilfH69 2 หลายเดือนก่อน

      Hey, Xamarin is being deprecated on May 31, 2024 so eventually if you don't migrate you will not be able to submit to the app stores and there will be no more security fixes or bugfixes. So it is advised to migrate.

    • @RichaMaheshwari-ht4iu
      @RichaMaheshwari-ht4iu 2 หลายเดือนก่อน

      @@MilfH69 Thanks for reply but I have a doubt i.e if I follow the Microsoft tool for migrate there is lot of issue I am facing in my project and some time compiler is not detect and tell the proper error so is there any another way except manual migration and how we migrate Xamarin to MAUI in Mac

  • @user-zt6ju2zb7m
    @user-zt6ju2zb7m 4 หลายเดือนก่อน

    I got error as There are no target frameworks found to which your project could be upgraded.

    • @Toxicwaste79
      @Toxicwaste79 2 หลายเดือนก่อน

      Had the same problem. You can try the following: In the upgrade assistant choose "Upgrade project features" and then "Convert project to SDK style". After this, the installed frameworks were shown.

  • @Gardillus
    @Gardillus 10 หลายเดือนก่อน

    *than