The Modern .NET Show

S06E17 - .NET MAUI: Navigating the Cross-Platform Code Seas with Maddy Montaquila

Sponsors

Support for this episode of The Modern .NET Show comes from the following sponsors. Please take a moment to learn more about their products and services:

Please also see the full sponsor message(s) in the episode transcription for more details of their products and services, and offers exclusive to listeners of The Modern .NET Show.

Thank you to the sponsors for supporting the show.

Embedded Player

S06E17 - .NET MAUI: Navigating the Cross-Platform Code Seas with Maddy Montaquila
The .NET Core Podcast

S06E17 - .NET MAUI: Navigating the Cross-Platform Code Seas with Maddy Montaquila

Supporting The Show

If this episode was interesting or useful to you, please consider supporting the show with one of the above options.

Episode Summary

In the world of app development, having a cross-platform framework that simplifies the process of building applications for multiple devices is a game-changer .NET MAUI (Multi-platform App UI) emerges as a powerful solution, enabling developers to write a single codebase that runs seamlessly on various client devices such as Android, iOS, macOS, and Windows. In this article, we delve into the key features, insights, and experiences shared in an episode of “The Modern .NET Show” podcast to uncover the potential and growth of .NET MAUI.

Maddy Montaquila, this episode’s guest, highlights that .NET MAUI offers a robust framework for client app development, encompassing web, ASP.NET Blazor, console apps, and more. With its integration of XAML and C#, developers gain the flexibility of choice, allowing them to build their UI, business logic, and endpoint management in a single codebase. The evolution of .NET MAUI from Xamarin brings the power of Xamarin’s mobile-focused approach to a broader scope, encompassing mobile and desktop platforms.

This episode also sheds light on the .NET MAUI extension for Visual Studio Code (VS Code). This extension allows developers to work on mobile and desktop applications for various platforms. VS Code’s C# extension provides analysers and code completion for streamlined C# development. Additionally, the .NET MAUI extension in VS Code simplifies deployment to local machines, devices, and emulators across multiple platforms.

Transitioning from Xamarin to .NET MAUI is a fairly straightforward process. Microsoft provides the .NET Upgrade Assistant in Visual Studio to aid developers in the migration process. While the tool automates many tasks, developers may need to address namespace changes, update project files to the modern CSProj format, and manually resolve any errors that arise. Despite these considerations, the transition is smooth, ensuring that existing Xamarin customers can seamlessly move to .NET MAUI.

To demonstrate the power and versatility of .NET MAUI, Montaquila highlights real-world examples such as the migration of Bitwarden, a password manager app, from Xamarin to MAUI. Bitwarden’s open-source GitHub repository showcases the app’s robust backend and secure password storage. The migration to .NET MAUI demonstrates the framework’s ability to handle complex, secure applications with ease.

The emergence of .NET MAUI as a robust cross-platform framework has revolutionized the app development landscape. Offering a unified approach to building applications for Android, iOS, macOS, and Windows, .NET MAUI’s growth and adoption among developers are evident. With its seamless integration with Visual Studio and its own extension for VS Code, developers can leverage a comprehensive suite of tools to streamline their development process. As the framework continues to evolve, .NET MAUI holds immense potential for creating transformative and efficient app experiences across multiple platforms.

Episode Transcription


On Apple Podcasts

Just a quick note for those of you are iOS users (around 40% of the community of listeners):

When iOS 17.4 drops, you'll be able to read transcriptions for the show in Apple Podcasts. Problem is, I have no way to test whether these transcripts are correct or not, and given the technical nature of the show (and my own experience of creating the transcripts for the website) I doubt that they'll be correct.

I'm working with the podcast hosting company that I use for the show to figure out the best way to provide in-app transcripts, but until then I can't guarantee the quality of the Apple provided transcripts.

The best place for a transcription will always be the show's website, and there will be a link to this episode's transcript in the show notes.


Yeah, so .NET MAUI is the .NET stack, framework, whatever you want to call it, for writing one code base that runs on what we call client devices, client platforms.

So you have the web, you have ASP .NET Blazor and all that stuff. You have the console apps, you can write with C#, of course, so many backends and APIs and all of that stuff running in the cloud. But with MAUI, it’s for client app development. So Android, iOS, macOS and Windows, you can target using XAML and C#, or just C# if you don’t like XAML, or Razor if you want to. All are options.

But you can write one code, business logic, your UI, all of your endpoint management and everything, all of that. And it’s just written in C#. It’s a .NET application. It’s using .NET MAUI

- Maddy Montaquila

Welcome to The Modern .NET Show! Formerly known as The .NET Core Podcast, we are the go-to podcast for all .NET developers worldwide and I am your host Jamie “GaProgMan” Taylor.

In this episode, Maddy Montaquila joined us to talk about .NET MAUI—the Multi-platform Application User Interface—what it is, it’s history, and why developers who are looking for a first-party UI-framework their modern .NET apps should check it out.

We can do that totally within MAUI. It’s actually pretty easy.

So you can just say like, "on platform Android, do this," or "on idiom," we call them idioms, right? Tablet, desktop, or phone. "On idiom, do this."

We actually have customers who will ship in the same code base, like two completely different navigation stacks. So it will say, "on desktop, load it up with this nav stack and load into these pages. On mobile, load it up into this nav stack and load up these pages." But since you can share the components, you can basically say, "the navigation of my desktop app, everything is horizontal, but I pull in the same components. It’s just like a different grid view than I would do on mobile where it’s all stacked on top of each other and it’s a scroll." Right?

So you can get super flexible with all of it.

- Maddy Montaquila

So let’s sit back, open up a terminal, type in dotnet new podcast and we’ll dive into the core of Modern .NET.

Jamie : So thank you, Maddie, for arranging some time today because I know we’re all in different time zones and you’re on the other side of the planet and it’s sometimes difficult to figure things out like that and life sometimes gets in the way. So thank you very much for being on the show.

Maddy : Thank you for having me. I appreciate it. I’m glad I’m able to actually be on the show for once. I’m very impressed by all of the technology you have going into to make the podcast sound so good. So I’m excited to be here.

Jamie : Thank you very much. That’s a mini shout out to the editing team and Mark, who’ll be editing this one. Thank you very much, Mark. Awesome.

So, yeah, Maddie, for, you know, some of the people may not know who Maddie is. What Maddie walks on. I was wondering, could you give us a bit of like an elevator pitch or a short introduction to the kind of stuff that you do over at Microsoft?

Maddy : Yeah. I am a Product Manager on the .NET MAUI team. So product managers kind of work between the engineers and the customers and the folks on the marketing side and the Azure side and all over, and we basically try and help drive the product direction. And I’m sure that every Product Manager will tell you a different definition of what they actually do in their.

So I’m on the .NET MAUI team and so it’s awesome because we’re part of .NET, but we’re really focused on the mobile and desktop cross platform technology. MAUI stands for Multi-platfom App UI. Even though it is more than Ui. It’s also kind of native APIs under the hood and a whole bunch of stuff. But I’ve been on the team for five and a half—I’m coming up to six years, which is crazy. I started off fresh out of college and I was not a .NET developer and I thought that I was like .NET sounds cool. That sounds fun. And I’ve stuck it out since and I really love it and I can’t imagine being on any other team now. So yeah, it’s been a journey for sure.

Jamie : Nice. Nice. Okay. And I just want to make this really clear. I do this with anyone who works for big corporations who are on the show. I’m obviously talking to Maddie and it’s up to Maddie as to whether her answers represent Microsoft or not, but I’m going to assume not. So like, hey Maddie, I’m talking to Maddie. I’m not talking to Microsoft, right?

Maddy : Very, very good question. Thank you for clarifying. Yeah. Everything you’re going to get is my opinion or understanding of a situation. Even with the things that I know intimately about, I actually don’t really know what’s going on half the time. So just safe to assume it’s my opinion.

Jamie : I’m like that 24 hours a day. I’ve reached that point in my career and my age where I’m like, "wait, I remember what namespaces are."

Maddy : Yes. Object-oriented. Yes, that’s a word.

Jamie : What? C hash? I can’t remember.

Cool. Okay, so you’ve got a varied experience with all the .NET things started with .NET and stuff like that. So you mentioned .NET MAUI, and you said the lovely acronym and stuff, but you said it’s more than just UI. So I guess just to set sort of the base level, what is .NET MAUI?

Maddy : Yeah, so .NET MAUI is the .NET stack, framework, whatever you want to call it, for writing one code base that runs on what we call client devices, client platforms.

So you have the web, you have ASP .NET Blazor and all that stuff. You have the console apps, you can write with C

, of course, so many backends and APIs and all of that stuff running in the cloud. But with MAUI, it’s for client app development. So Android, iOS, macOS and Windows, you can target using XAML and C#, or just C# if you don’t like XAML, or Razor if you want to. All are options.

But you can write one code, business logic, your UI, all of your endpoint management and everything, all of that. And it’s just written in C#. It’s a .NET application. It’s using .NET MAUI to target all those different native mobile and desktop platforms. And so it’s about, is it 18 months? Is it more than that? We shipped as an evolution of something called Xamarin, which was really focused on mobile only, but we rolled it properly into .NET with the runtime and the base class library and all those things.

And then we shipped it in May of 2022. So yeah, a little bit more than 18 months. We’re coming on two years and we’ve seen like explosive growth and everything. So we’re really happy with show it’s going so far. Definitely a lot of work to do still, but now that it’s been out in the world for over a year, it is really starting to get its kind of footing and we’re seeing a lot of customers pick it up for the first time and really enjoy using it. So it’s exciting.

Jamie : Nice. Okay. Because you kind of pre-empted a whole bunch of my questions.

Maddy : Sorry, totally just started rambling.

Jamie : That’s totally fine. Hey, editor. Mark, roll the exit music , yeah?

Maddy : Yeah.

Jamie : We’re done.

Okay, cool. So there’s a whole bunch of stuff that you said there, but I just want to pick up on one thing that some other developers may know of, and that is Xamarin. It was kind of a big deal. So then you said it’s an evolution of Xamarin, right? So obviously that implies to me it’s continuing the life or the setup that Xamarin would give me. Right. So does that mean that Xamarin is going away?

Maddy : Yeah. So MAUI is the replacement.

It’s basically like Xamarin next version. In most cases, there are some changes, but the history lesson, the quick history lesson is Xamarin was a separate company that shipped an open source version of .NET called Mono, and they were acquired by Microsoft after .NET became open source. And so the Mono team and the .NET team over the past eight years or so, I believe. Yeah, eight. 2016. Started to meld more and more. And then they decided instead of shipping two completely separate runtimes, one focused on mobile, which was Mono, and webassembly is the other thing that Mono was really big for. And then the other, of course, focused on web and backends. Why don’t we consolidate it and make it all .NET and bring in the specialized, the good parts of mono into .NET properly and only have differences where it makes sense?

And so under the hood, .NET was merging together, and we had Xamarin, which was the mobile technology to target Android and iOS, and UWP, Windows Phone, which people were using for desktop, although we never really paid attention to desktop. And we decided that would be a good time for us to roll that mobile brand fully into .NET, which is when we came up with MAUI. And so because we changed our name, we were totally allowed to break things.

I’m just kidding. That’s not how it works.

But we did make some breaking changes. We changed the namespace, so it’s no longer using Xamarin forms, it’s using Microsoft.Maui. And we got rid of some old kind of hacky skeletons in the closet we had done when Xamarin forms, which was the cross platform UI layer of Xamarin, was created in 2014/15. And we refreshed all of that with MAUI, too.

So there are some changes you have to do. We have tooling to do a lot of the repetitive stuff, but for most of our customers, if you are on Xamarin or Xamarin forums, upgrading to MAUI is fairly straightforward at this point. For a long time, it was mostly like, "the libraries I use, or like the NuGete packages I have aren’t ready," and so you had to wait for that. But now we’ve seen the momentum pick up quite a bit, so yeah.

And then if you were a Xamarin customer and you don’t want to do cross platform UI, we just don’t call it something different any more. It’s just .NET for iOS and .NET for Android. So you can still totally write native iOS UI separately from your native Android UI and use C Sharp as your backend or your business logic for that application. But it’s just .NET. So MAUI is the cross platform layer for mobile and desktop for UI and also device specific stuff.

Jamie : So let’s say I have a Xamarin forms app, just as an example, pulling some things out there. I’m probably not doing anything super complex. I’m probably not using many third party NuGet libraries. I’ve probably just done the equivalent of, in the time before, File > New project > Xamarin forms, written a bunch of stuff. I might just be able to go, "hey, csproj migrate to .NET MAUI or the equivalent," right? And it may just work, right?

Maddy : Yeah, we have a tool in Visual Studio. It’s an extension, but Microsoft maintains it. It’s called the upgrade assistant. The .NET Upgrade Assistant. And that is what goes through and does all the repetitive, kind of like fix all the namespaces. The biggest thing that we see not migrate cleanly is the actual project file itself. So as part of combining the runtimes—Mono and .NET—we standardized on the modern csproj file, which is basically how Visual Studio understands what’s going on in your project, in your .NET project. And so some of the stuff from Xamarin doesn’t quite migrate over perfectly.

So the upgrade assistant does like a best guess. And then basically what we see people do is they hit F5 to run the app. And then there’s usually a pretty descriptive error that pops up that’s like, "hey, you can’t do this thing," or like, "this thing doesn’t make sense." And then you can either figure that out, or Google it, or whatever it is and kind of hack your way through it that way. We have seen that if you do a File > New > Xamarin app and you upgrade it straight up, that does work. So at least that scenario is covered. But most people are not File > New, I’ll say.

Jamie : Of course, right, because you get more than 30 seconds into developing something and you’re changing things around, you’re adding packages, you’re including files, you’re maybe including PFX files, or maybe including some kind of resources that you might need, that it may need to rewrite things. I totally get that, right? You can’t possibly cover every single possible permutation of how a file can change, right? I totally get that.

Maddy : Yep.

Jamie : Oool. Okay, so we’ve come from that perspective. I have my Xamarin or Xamarin forms app. There is a tool to help me get there. And then of course obviously the C Sharp compiler, the Visual Studio tools, they’re pretty cool. If I get something wrong, it’s literally going to tell me, "hey," in my instance it says, "hey doofus, line seven, character eight, you’ve put a semicolon when really you need a dot," right? That’s really cool.

It doesn’t actually say doofus, obviously, but that’s really useful to me.

Maddy : I would want it, like if I’m in a good mood I would want it to tell me, like nice things, like, "hey smart pants, something stupid." And if I’m in a bad mood it’d be like, "hey idiot."

Jamie : Maybe the, that’s the next level of Generative AI, right?

Maddy : Yeah, that’s not bad idea.

Jamie : Build an extension for VS Code with GitHub Copilot that detects your sentiment whilst you’re typing. And if you’re in obviously a good mood it says, "hey look, you made this mistake, but don’t worry, I can help you." And if you’re obviously in a bad mood, "yo doofus!"

Maddy : That would be great.

Jamie : Million dollar marketing idea, let’s get it done. Excellent.

So we talked a little bit about Visual Studio there. What about if I’m one of these folks who’s doing everything in Visual Studio Code? Is that a thing that I can do?

Maddy : We just, well we just, not "just" it’s January, oh my goodness.

Over the northern hemisphere summer we shipped an extension for .NET MAUI development in VS Code, and we also shipped that alongside or as part of or along with the C# Dev Kit and updated C Sharp extensions.

So C Sharp, the C Sharp extension just gives you Roslyn based analyzers and completion and whatever for C Sharp. IOt’s the same thing as if you installed like a Javascript extension that just does syntax completion and all that stuff. It’s awesome. It’s super powerful. VS Code with just, that is honestly great. But what we did with C# Dev Kit is we made VS Code aware of the Visual Studio project system so you can actually open, like I was talking about, those csproj files so it understands what that is now and it’s able to open things in a solution and project structure instead of just a bunch of folders, which is how VS Code usually handles things.

And then on top of that we built the MAUI extension, which gives the ability to do deployment to your local machine or any kind of device or emulator you have on your machine. So if you’re on a Mac you can do anything that XCode supports, you can install Android, you can plug in your phone, or you can do it locally to the Mac. If you’re on Windows, you can do the Windows machine locally or Android emulators. And if you plug a device in. And then if you’re on Linux you can actually do Android development through either emulators or a device too, which has been really fun because we previously had no way to develop on Linux. So it’s been cool to see people being able to do their Android development with VS Code on Linux.

And it’s still in preview as of the time of recording. We’ll probably be flipping it over to not preview at some point soon. But the VS Code is very different than Visual Studio and how they do things. It’s been a fun learning experience for the team and so preview doesn’t mean as much. It’s just a button we turn off at some point. And so we have a bunch of features we’re working on adding, but so far I’ve been using it primarily on my Mac. I have not opened an IDE of any sort on my Mac since we shipped this extension and it is pretty good. So I’m enjoying it. It’s fast, it’s lightweight. I used to be like a Linux command line only person, so I feel like I’m getting back into that, which is fun, but yeah.

Jamie : Cool because yeah, that was going to be a selfish question that I ask because I’m a macOS and I think it’s Ubuntu. Well it’s actually a Linux desktop based on Ubuntu. It doesn’t matter, right? There’s a million of them and it’s based on Ubuntu. Yeah, I’m sure the people who make Pop_OS! will be very happy to hear me say Pop_OS!.

Maddy : I have heard of Pop_OS!.

Jamie : Awesome. Hey, system 76, if you’re listening, send me a computer.

Maddy : Yeah, really.

Jamie : So I run a Linux on the desktop on a couple of my different machines and I’ve got a macOS and I got a windows and I’m like this is great. When .NET MAUI first came out I was like, "cool, I’ve got my Rider installed on my MacOS, I can do .NET and .NET MAUI things on there. I’ve got Windows, I can do Visual Studio. Brilliant. What about my other machine?"

And I totally understand that, obviously there are only so many engineers, but knowing that there’s now a part of the product that I can use on my desktop where it’s not as powerful as my M2, but it’s pretty powerful. So I’m like, "oh cool, I could do my .NET MAUI stuff here too."

Maddy : Awesome. I love.

Jamie : Awesome. Yeah.

Okay, so let’s say, before we start talking about how I could develop for an Android phone or an iOS or whatever. What can I use .NET MAUI for? I think you did answer this one, but obviously because we’re so information dense because listeners, that’s what it’s like when talking to Maddy. She’s brilliant. But you get like all the things all at once.

Maddy : Yeah, my brain, unfortunately it starts and then for me to stop it is know I have to slam on the brakes. So hard. So thank you for sticking with me.

Yeah, so it is mobile and desktop, Android, iOS, macOS and Windows. We don’t have Linux desktop support right now, mostly because, and you probably know because you’re a Linux user, there are about 8 million ways to build Linux UIs. And for us to pick one would probably be a lot of breaking the people’s hearts. But we’re looking at what the best way to do that is, whether we ship our own thing, or if we can rely on web or a web view. So Linux is not totally out of the question. It’s just not there right now.

But the succinct answer is Windows, MacOS, iOS and Android. And you can probably hear my dog shredding a paper bag in the background. But hopefully not because. Sorry Mark. Sorry, Producer Mark. Because his favourite toy is a plastic bag. He has about a million stuffed toys, but an Amazon box or like a paper bag is his favourite.

Jamie : That’s totally fine.


Do you have a WPF application and want to take it to macOS or Linux? Avalonia XPF, a binary-compatible cross-platform fork of WPF, enables WPF apps to run on new platforms with minimal effort and maximum compatibility.

With a few tweaks to your project file, your WPF app and all its dependencies are ready for testing on new platforms.

Start your app transformation journey with a 30-day free trial.

Head over to http://avaloniaui.net/themoderndotnetshow to get started today.


Jamie : Okay, so we’ve got Windows, Android, MacOS, iOS, all that kind of stuff. So then I can literally just do, I guess the equivalent of File > New… I don’t know, File > New > .NET MAUI iOS and I can just hit run on my Mac and it appears on the simulator. Or is it like, am I targeting something more generic and then saying, "hey, actually build me an iOS package as well?" How does that work?

Maddy : That is a great question. So it relies on the native tooling. So if you’re on a Mac, you need XCode and then we port everything through XCode to run it. So when you hit debug or F5 or whatever you want to call it, it goes through the XCode deployment basically through the command line. It’s not like you have to have XCode open and click the buttons there, but we, under the hood, wire it all up and use the XCode simulators or the native macOS build tools to do that. So we don’t do any interpretation. It’s a full native app by default. We’re building the correct app type or app bundle for the platform you’re on. So that helps a lot with performance and also just general kind of usability.

Jamie : Okay. Because that was something that I think I’ve misunderstood for a long time because I was like, "I’m building my .NET app, and clearly it’s being interpreted at some point and running .NET on my phone," but that’s clearly not the case then, right?

Maddy : Yeah, the runtime, we package the runtime up with it, and the runtime is what’s able to translate it into native code. But by the time it’s on the phone, it’s just a native app running natively.

Jamie : Okay, cool. So I’ve done file new, or I’ve done dotnet new, I guess dotnet new maui or whatever the command line is. It’s been a long time, and you hit debug. It goes through XCode, it comes out in the simulator. Or if I’ve got an iPhone plugged in, it appears on my iPhone.

Am I debugging at the same time? So like I’m running my app, I’ve got the VS Code with .NET MAUI extension. I’ve set up a breakpoint on some view or some action, I push the button. Will it break as well? Or am I doing something else? Adding some other tool into the tool chain to allow me to debug?

Maddy : No, the debugger is built right in with .NET. So as long as you hit F5 and not Control+F5, it debugs and we build and debug by default. If you wanted to build it for release, that’s also totally an option that skips all of the debugger libraries and protocols there, which will make your app a little bit slower because we have to debug it. But it’s all built right in, so you don’t have to do anything funky to make that work.

Jamie : Okay, so let’s say I switch over to my Windows—this is the problem— Iwitch over to my windows machine, and I’m like, I want to continue building my iOS app. That’s when things get a bit funky, right? Because there’s like licensing with Apple and you have to have an Apple machine in the tool chain and things like that. Is there an answer for that? I don’t know.

Maddy : Not currently for VS Code for Visual Studio itself there is.

So what you can do with Visual Studio is pair over your local network to whatever Mac machine you have, and it will use all the XCode stuff from that Mac to build locally on Windows. If you want to build onto an iPhone without having a Mac in the loop, you can plug your iPhone in and use something called hot restart. So it’s kind of limited. It’s basically like running the app, your app, your code inside of an app package. So only locally, only during debug. Right. It’s not something you could ever push to the store like that, but it does get you a lot of the way there. And we see a lot of people use it if they’re just doing like, UI design or basic kind of functionality just to test it, and then they give it to whoever on their team or whatever has the Mac and they double check everything else.

So we do have a lot of flexibility with that, which is nice.

Jamie : Right. Okay. And just for clarity’s sake there, for people listening in who’ve maybe not done .NET MAUI or Xamarin or anything like that, that’s an Apple thing, right? That’s not a, "you guys are intentionally hampering the developers." That is literally an Apple licensing thing with XCode, right?

Maddy : Correct. Yep. Apple wants to make sure that, I think they have a good reason for. Honestly, like, a lot of it is for security, which I think is a very valid thing. They want to make sure that everything goes through their build tool chain on their hardware before it gets into the App Store.

Jamie : Yeah. And that makes total sense, right? Like, if we dial back maybe 10 years before the majority of DevOps and cloud computing came along, you would probably want—f you were a big enterprise—you would probably want all of your source code built by one particular bank of machines to do the same thing. Right? Put it through your same tool chain, maybe do some code signing, maybe do some vulnerability scanning. Maybe they’re doing that, maybe they’re not. But it totally makes sense that they would want to do that, right?

Maddy : Yes, absolutely.

Jamie : Cool. Okay, so we’ve done iOS. Now I’ve built my app. It works on my iPhone, and I have an Android laying around. I plug my Android in, I’m in Visual Studio, or maybe I’m in Visual Studio code. I go, "hey, target this device. Run," and it just works, or do I have to? So I know this is a bit of a leading question. I know that I can enable developer tools on my Android. Do I need to do that to be able to deploy the debug version of my app on my phone?

Maddy : Yes. So you have to go into the Android developer settings and say, like, "it is okay for someone to stick an app package on this over usb or over wireless," but Android is nice of them to make sure that you are allowed to side load things. Otherwise, hypothetically, like, if you plugged your phone into something in an airport, there could be an app package ready to go right onto that. And that would be an attack, basically.

So you have to turn it on. But once it’s on, it’s on for your computer, it remembers it, and so it’s a one time thing at least.

Jamie : Right. Okay, so switch that on inside of Visual Studio or Visual Studio Code with the .NET MAUI thing, I do some step, it will be different for both, I guess. Do some step to say, "hey, target this device. I hit run." Boop. My app is now deployed to my phone, and I can interact and get the full debugging experience we just talked about for iOS, right?

Maddy : Yup. Exactly.

Jamie : Wow. Okay, cool. There’s people listening in going, "yeah, but we could do this in XAML, Jamie. In Xamarin. Jamie don’t get too excited." But, I mean, that’s genuinely. Right. I know I’m talking to you, Maddy, and you work for Microsoft on this team, but genuinely because of all of the sheer number of moving parts involved. That’s amazing.

Maddy : Yeah, it is actually unbelievable that it works at all. But the people on the teams, I just get to kind of sit here and talk about it and say, "like, oh, we should do this," or, "oh, let’s make this better." But we have some of the most brilliant people I’ve ever worked with or talked to in my life on our team, and they understand so much about the native platforms so that our customers don’t have to. If we have someone who’s an expert in iOS, then you don’t have to become an expert in iOS when you build your mobile apps, and it’s awesome.

Jamie : Okay. That is pretty cool. And then it works. You said on macOS and Windows desktop, right?

Maddy : Yes. Yup.

Jamie : Right

Have I lost you, Maddy?

Maddy : No, I’m here. Am I here?

Jamie : No. Okay. Sorry. I thought my headphones were going a bit weird, that’s all. Sorry.

Maddy : But, yes, it does work on both desktops, Mac and windows, and then iOS and Android.

Jamie : Right. Okay. So I suppose there’s potentially some learnings for a UX designer or a UI person to be able to think, "right. How is this going to work on a mobile device? And how is it going to work on say, a laptop or a desktop?" Right. But I feel like that maybe falls outside of the tooling that MAUI provides. Right. It’s not like I could pull in Bootstrap like I would for web and just go, "oh yeah, in a large screen format like this. On a small screen format like this."

Maddy : We can do that totally within MAUI. It’s actually pretty easy.

So you can just say like, "on platform Android, do this," or "on idiom," we call them idioms, right? Tablet, desktop, or phone. "On idiom, do this."

We actually have customers who will ship in the same code base, like two completely different navigation stacks. So it will say, "on desktop, load it up with this nav stack and load into these pages. On mobile, load it up into this nav stack and load up these pages." But since you can share the components, you can basically say, "the navigation of my desktop app, everything is horizontal, but I pull in the same components. It’s just like a different grid view than I would do on mobile where it’s all stacked on top of each other and it’s a scroll." Right?

So you can get super flexible with all of it.

We have an example app on one of my colleagues, David Ortinau’s GitHub, and I think it’s also in the MAUI samples repo right now, but it’s like a food ordering app. So the mobile app would be for the customer to go, excuse me; for the waitress or waiter to go and add things to that customer’s cart. And then there’s like the tablet or desktop version that would be for your point of sale where you can check everything out and see what orders are there.

So it’s a really cool example of what I was just saying. That paradigm of like having two completely different navigation stacks in the same code base.

Jamie : Right? Okay.

Am I styling things differently for every stack, or if I say, "draw me a button," and I go to run it on iOS, it’s going to draw me an iOS like button. And when I go to Android it’s going to draw me an iOS like button? Or do I need to say if Android style it like this? If iOS style it like this? Am I using the native components for that?

Maddy : Yeah, you’re using the native components under the hood by default. So it will look and feel like an Android or an iOS app without you doing anything. Which is, I think, great by default. However, if you are in a company that has very strict design patterns, you probably want everything to look the same everywhere. So you can, of course, customize the like however much you want to look the same. But by default, we give you the native under the hood situation, which is pretty flexible.

Jamie : Yeah, that sounds good. So then if I’m sitting on my Mac and I hit run, I get the close, minimize, maximize in the top left. And if I’m on my Windows, I get close, minimize, maximize, top right. And my button on a Windows, is it win UI?

Maddy : Yes, win UI is technology on Windows. For Windows cooling, I mean, not cooling. Oh, my gosh. For Windows development. I don’t know why that was in my head.

Jamie : All right, cool.

Maddy : Still early. I haven’t finished my coffee yet. It’s halfway done.

Jamie : That’s okay, listeners. If you want to take a moment and finish your coffee, you do that too.

Maddy : Now we’re good. Keep on keeping on.

Jamie : Cool. Yeah. And then I guess if I say, "hey, MAUI, draw me a button and I run on my macOS," like you said, we’re using the native tooling, right? So it will draw me whatever the Mac. I don’t know what the macOS.

Maddy : So there’s few libraries. The default, like fully native one is UIKit, but what we use is Mac Catalyst, which is their "runs everywhere" Mac app thing. They are really pushing a lot of apps to use it. It’s kind of like their more modern version, but it’s not as in depth as what you can do with UIKit. But for Mac desktop apps, it gets the job done really well for our customers.

Jamie : Okay, cool. And then I think you hinted at this earlier on, but you said you can use XAML or you can use C Sharp to sort of declare your UI. I happen to know—again, leading questions, I’ve used .NET MAUI—but when I’ve done Xamarin stuff, there’s like a Xamarin, sorry, .xaml.cs and a .cs file. And one sort of hides under the other inside of Visual Studio. And once your view wants your code, is it still that sort of paradigm or how does that all fit together?

Maddy : Yeah, by default, yes.

So we use XAML to describe your UI. It’s a markup language. But if you want to just avoid XAML altogether, you don’t even have to do the .xaml.cs, yYou can just have pure C Sharp files as your UI. We have a lot of customers doing that. The built in C Sharp UI syntax, I guess, is very verbose, but we have something in the community toolkit called C Sharp for markup.

Editor’s note: This is actually called Maui.Markup

Maddy : There’s also things like ReactiveUI and a whole bunch of other third party tools that people have rid to make C Sharp description of UI way more clean looking in your code base and just a little bit more flexible. So people are doing it all different ways. We’re actually working currently on creating like a template that just doesn’t have XAML in it. We’re not sure how we’ll ship that because most people want to use XAML, but it’s just something we’re experimenting on and seeing where that takes us.

Jamie : Cool. Okay.

How do I sort of architect my app then? So I know. Again, leading question, right? I know that MVVM is a thing for those who don’t know, that’s model-view-viewmodel. So do I need to use that? Or can I use something a little bit more MVC ish? Or can I just wire up everything inside of the code behind, say like win forms? How does all that work?

Maddy : Yeah, MVVM is again the default, but you don’t have to do anything. Model-view-viewmodel.

And that’s what we generally recommend. That’s what most of our documentation is written with. Right, assuming you’re using some form of a view model and that code behind pattern. But we have people writing all sorts of apps. I mean, half the apps I write do not use, "blessed MVVM," I use like, "pseudo MVVM." Whenever I feel like it, I do it right. And then when I don’t, I don’t.

You can be super flexible. And again, like ReactiveUI UI is a really popular third party package. That is a different style of architecture. We have some experiments. Like one that has gained a lot of traction is Comet, which is using MAUI under the hood, but it’s a model-view-update (MVU) style architecture for writing your mobile app. So just a completely different way to think about it. And so, yeah, it’s really whatever you want.

And I think, I’m sure you’ll have a question about this. So I’ll pre-empt it. One thing that we’ve seen a lot of customers doing is just using Blazor to write their MAUI UI. And so you can basically plop your Blazor app, right in a MAUI app. And it will run natively on the desktop or on the mobile phone, in the webview, the native web view. So WebView2, I believe, on Windows and whatever it is on Mac and on the phone.

Jamie : That’s cool, because that then allows, I guess, you to have that little bit more of a control. Let’s say you don’t have any experts in the team who know MVVM, but they’ve built something with Blazor that will do the majority of what you need to do. You can just go,"copy paste" or the equivalent of deploy or whatever. And there we go. We’ve got the app running without a browser, technically without a browser on the.

Maddy : Exactly. I mean, it’s in the webview. So people are like, "oh, so I have to run the browser?" No, it’s not. It’s the native webview tooling. All it’s doing is rendering the UI. It’s not calling the web in any way. So yeah, it’s pretty cool.

Jamie : Yeah, nice. Because I know that there’s some stuff at the moment to do with. So I’m not fully versed in iOS, but I do know that there’s safari on iOS and PWAs. The ground is a bit shaky on that. But hey, this can get you one step closer to running your app in a browser-like context, using .NET MAUI on your iOS device. Nice.

Maddy : Yeah, you got it.

Jamie : Nice. Okay, cool. And then does that work with Blazor in any other context? I know that’s a really vague question, but is that the only connection that MAUI has with Blazor?

Maddy : So directionally, like putting Blazor into MAUI, running Blazor locally via MAUI? Yes. We can’t run MAUI on the web through Blazor if that’s one way you can look at that. The other thing though is that with Blazor you don’t have to do a whole Blazor app or a whole Blazor UI or even a page. You can do just single components and just plop those into MAUI apps wherever you want. So say that your web team has like a really niche calendar component and you don’t want to use the native calendars by default because they don’t have the feature you need or whatever. You can just take that web calendar component that the Blazor team used, or a third party Blazor component if you want to use something from the Blazor community, and stick that by itself in the MAUI app and it will respect the state and the content and everything in MAUI. And it’s not like you have to pass things between it. So, it’s very flexible in that way.


A Request To You All

If you're enjoying this show, would you mind sharing it with a colleague? Check your podcatcher for a link to show notes, which has an embedded player within it and a transcription and all that stuff, and share that link with them. I'd really appreciate it if you could indeed share the show.

But if you'd like other ways to support it, you could:

I would love it if you would share the show with a friend or colleague or leave a rating or review. The other options are completely up to you, and are not required at all to continue enjoying the show.

Anyway, let's get back to it.


Jamie : Okay, so I may be pushing this metaphor a little bit too far, but let’s say in my organization we have like a header and a footer that is styled correctly to whatever brand guidelines, we’ve got a header written in as a Blazor component. We can perhaps just pull that into the app and say, "hey, that’s my header, that’s my footer for all of the navigation in this app."

Maddy : Yes, exactly.

Jamie : Right. Okay, see I love that code reuse, right? Because you change it in one place and it just propagates everywhere else. I love that.

Maddy : It’s really awesome. And especially now that the web like having a web experience is so important. But having a mobile experience is really important for discovery, and the native platform stuff, and security in a lot of cases right. Offline support, it’s made it really easy for folks to expand from one to the other.

Jamie : Like you say. Okay, I’m going to try and pick my words really carefully here. You don’t necessarily need to hire someone who is an expert at iOS design and iOS app architecture because then you can have your .NET devs learn how to use .NET MAUI and guess what? You’ve got an iOS app with the correct infrastructure—architecture, sorry. And the correct design things and you’re not having to speak different design languages and you can have one team to rule them all sort of thing.

Maddy : Exactly. Yep.

Jamie : Yeah, nice. Okay cool.

So then, okay, right, so we talked about Visual Studio. We talked about Visual Studio code and we talked about the .NET MAUI extension for Visual Studio code. Is that literally all I need to install? So I know that in the early stage, I don’t know if it’s the same thing, but in the early stages of .NET MAUI I had to do like on the command line dotnet install payload or workload, sorry, windows workload, macOS, things like that. Do I still need to do that in order to build?

Maddy : So if you’re on Windows. So for the Windows developers, which I know isn’t you, but that’s the easiest path. All you have to do is install Visual Studio and check off the MAUI box and it pulls in literally everything you need.

Using VS Code. So on Mac or Windows if you want to or Linux, you install the extension and then you have to do dotnet workload install maui. But that will pull in all of the .NET related native bits, and then you can install the native tool chains for what you want to develop on.

So almost every developer on Mac will have XCode. So XCode is required for the iOS and macOS stuff. So you can just install XCode, you have to open it once and then VS Code will pick up that it exists and let you start using those build tools.

For Android you have to install OpenJDK and then you have to install some of the Android build tools. But again we have like docs that walk you through it. You can do it all through the command line if you prefer. You can also install Android studio and use their tooling to manage your SDK and emulator on the Android side if you want.

There’s plenty of options there, but you do have to have the native tool chain for whatever app type you’re building. On Windows. If you just want to target Windows, all you have to do is install MAUI because .NET is obviously running locally and the Windows build chain is built into Windows.

Jamie : Question about yeah, that was going to be my question about the Java development kit because obviously knowing a little bit about these devices, I know that one of the ways to build Android apps is to use Java. So I was like, "do I need to install that myself?" And do I need a specific version? But if it’s all documented, then I just follow the steps, right?

Maddy : Exactly. aka.ms/mauidevkit-docs. That should have everything you need.

Jamie : There we go. And that will be linked in the show notes, folks. So don’t dive across your dashboard to write that down whilst you’re driving somewhere. Please drive safely.

Maddy : That’s a good call.

Jamie : So what about like. Okay, so I built my app, it runs perfectly on my device. Fantastic. I have a CI/CD pipeline, say GitHub actions or something, and I want to be able to, when I push to main or whatever, it’s going to build me my app. Is there a GitHub actions thing to produce? Bundles, executables, packages? They’re all named differently, right?

Maddy : Yeah, I know it’s weird because it’s all in one place, but it’s also still all native. Yeah, you can do all of the GitHub actions magic that you would want with MAUI because they’re native apps. You basically just have to build it like a native application. The MAUI stuff really isn’t that important, but there are tons of blogs and documentations of people showing different ways of how to do it. Yeah, it’s mostly the native tool chain once you have the actual code base built, so that’s pretty good. And a lot of it’s command line based too, so very flexible.

Jamie : Cool. And automatable as well, and scriptable and all that kind of stuff, right?

Maddy : Yeah, exactly.

Jamie : All right, cool.

And then obviously I’m just going to ask this one. You and I both know the answer to this one. A listener may not, I’m not trying to point out anything to listeners or anything like that, but obviously: the .NET MAUI tooling is not there—its goal is not to sign a package ready to be released. Right. A developer will have to bring their own whatever signature thing required for iOS or Android or maybe for the Windows store. Right. There’s an extra step required, right. You’ve got your thing, you can deploy your deployable, I guess to, you’ve got that, but that still needs to be signed before it can be put onto the relevant marketplaces, right?

Maddy : Yeah, exactly. You have to have your own account, your own signing identity and key and all of those things to go into the store.

Jamie : Okay, cool.

And that’s outside of obviously because .NET MAUI is like, "let’s build your app so that it runs." It’s not, "let’s build your app so we can get it on the marketplace," which is fair enough.

Maddy : Right.

Jamie : Because like you said about Linux on the desktop, there’s about a million different ways to do Linux on the desktop for each platform. There’s a different way to sign your build the. I go ahead and build an iOS app and it’s ready to go. It goes through the signing process. I submit it to Apple, they’re not going to go, "hey, this is a .NET MAUI app and not a native app," because it is a native app. Right?

Maddy : Right. It is a native app. No one is able to tell it’s a MAUI app from just installing it or even in most cases cracking open the app bundle, which you can only do on Android. It’s just a native application. The only way that you can really tell it’s built with MAUI is if you’re on an Android and you crack open the app bundle, you have to look for basically like dlls in the file and that will tell you that there’s some .NET in there somewhere and then you can assume it’s built with MAUI or. Yeah, it is. It’s very cool how it doesn’t interpret it in any way.

Jamie : Right, cool. Yeah, I appreciate you answering that one because I couldn’t think of the right way to ask that; because I’m not trying to ask whether you’re saying Apple is stopping or Google are stopping MAUI apps on the store. I’m just like, somebody will likely want to know, "can I tell? Will it be denied access to the store if it’s .NET MAUI?" And obviously that’s not the case.

Maddy : Yeah, no, it is not. In fact, we make sure that everything we do is valid for both stores. We won’t build features that are not allowed to ship, basically. Yeah.

Jamie : Right. Okay, cool.

I think you’ve mentioned a few already. You mentioned how David Ortinau has some stuff in his GitHub repo and there’s some samples and stuff. Do you know of any particularly cool-to-you example apps, or maybe open source apps that people can be like, "hey, I’ve heard this .NET MAUI thing is really cool. I’m going to go download this source code and read how this app uses it." Do you know of any?

Maddy : Oh my gosh. Well, okay, so simple ones. The maui-samples repo on GitHub has plenty real world ones.

My favourite example is Bitwarden. They’re just finishing up their MAUI migration now and so it’s in a branch still. But Bitwarden is a password manager, so it goes in your browser on your phone. And the mobile app is built with MAUI, built with Xamarin and they’re migrating it to MAUI. So it’s almost there. And they do a ton of stuff. I use it personally, I used it before I realized they were using Xamarin. So it was very exciting when I found out. But they’re fully open source and they have obviously like a huge backend, very secure backend where they store your passwords and that’s in a repo, that’s open source on their GitHub and then the mobile app and the MAUI updates and all of that is also open source on their GitHub. So I point people to that all the time for like a real world, chunky, important secure application if you want to look at that/

Jamie : No, that’s, that’s pretty cool.

I do know that Cliff Agius, his previous version of his IoT hand project, I think he calls it handy, I’m maybe misremembering that, used Xamarin. So maybe, I don’t know. I haven’t talked to him in a while. Maybe he’s already upgraded or maybe there is an upgrade to get it to run on MAUI. Who knows? Maybe he just doesn’t want to do that because it doesn’t fit. I don’t know.

But I also know that there’s the .NET Podcasts app that was announced a while back because I remember, I think it was not the most recent .NET Conf, the one beforehand. And I was watching it live and I was in the chat and it was like, "oh, there’s this .NET podcasts app. It has all the .NET podcasts." I was like, "no, you’re missing one and it’s fine." Somebody pushed an update live that put this one in there. So I was like, "that’s pretty cool."

Maddy : Yeah. And the newest one is the eshop application too, that we reskinned. Basically we gave it a facelift at .NET Conf and now that’s running on MAUI. There’s also a Blazor version and it has some AI stuff built in. It’s very cool.

Jamie : That feels like the kind of the future of .NET stuff, right? Blazor, MAUI and AI things, right? That seems like it would be like the bread and butter for developers who are either starting new projects now or maybe those who I think we talked off air about, "there are some people in the .NET space who don’t get to play with the latest bits," that will give them sort of a taste of what’s coming down the pipe for them in maybe a couple of years, right?

Maddy : Yes.

Jamie : Nice.

All right then what about getting started then? In the user stories. right, the previous question was, "I am a .NET developer who knows about .NET MAUI and is doing some stuff."l But in the other one, in the other user story, "I am a .NET developer who has never used .NET MAUI." Where am I going to learn a little bit more about .NET MAUI?

Maddy : learn.microsoft.com is your number one place to go. They have a whole learning path, we call the with, a bunch of different modules for MAUI. So anything from getting started to basic MVVM to UI stuff; and then that will point you to some various MAUI 101 or get started with MAUI YouTube videos as well.

Folks on our team that create content a lot. James Montamagno is very popular. Gerald Versluis is very popular as well. And then there’s a ton of people in the community also pumping out MAUI content. Plenty of videos, plenty of blogs if you’re not a video person. So lots of options. Yeah.

But learn.microsoft.com is going to be your place to start with anything, really, with .NET, including MAUI.

Jamie : Cool. Okay. Yeah. Like I said, some of these questions are kind of leading; the last two interns and apprentices that I’ve had, I’ve gone, "hey, let’s build a .NET MAUI app together." And I basically went, "there’s James’s videos, go watch those for a couple of hours and then we’ll build something together."

Maddy : There you go.

Jamie : Each time they’ve gone, "oh, did you know you can do this?"

I’m like, "where did you learn that?"

"It’s the next video by James."

"Oh, right. Okay. I’ve only seen the first three or whatever," so that’s pretty cool.

Maddy : Yeah.

Jamie : Okay, cool.

So what about if someone’s listening through this and is like, "I got a question, maybe Maddy’s the person to ask." Is there a way to maybe connect with you and ask that question? Or is it just, "hey, go to the .NET account on your social media platform of choice and it’s there." Are you open to that? If somebody has a, "I have a question and it’s a genuine question about .NET MAUI and I don’t know where to get started." Can you help?

Maddy : Yeah, there are quite a few avenues. I would definitely, if you’re having an issue with anything in Visual Studio and Visual Studio Code, or with the MAUI SDK itself, definitely file that as a bug, because that’s how we can track it and make sure that there are eyes on it, and the engineering team will prioritize it appropriately. So sometimes people will email me like, "this thing isn’t working." And I’m like, "that’s great, you need to file a bug. I can’t help you. I’m so sorry."

And then you’re welcome to send me an email. maddy@microsoft.com I get a bajillion emails, so if I miss it, just keep emailing me. At some point I will probably see it. And then there’s also a great community for MAUI on Twitter and on YouTube—or sorry, on X as we call it now—and on what’s the other one? Mastodon and Threads. So if you tag things, you know #dotnetMAUI, or like #netMAUI, or you tag me, or Gerald Versluis or various other people on the .NET team, usually someone will see it, or someone in the community will see it and be able to help you out there.

I have been trying to not let my Twitter and social media feeds be all work because then when I’m just trying to relax, it’s also all work. So I’m not great at responding there personally, but I see a lot of people ask questions there, and get very involved with that social media interaction stuff. So that’s also a safe place.

And then if you’re a library maintainer or you have some really deep questions on MAUI, I don’t know, like complicated, not really getting started questions, but more like, "hey, I’m doing this niche weird thing." There’s also a discord server that you are welcome to join and a lot of the folks from the MAUI team and the community are on there and can probably help you out or at least point you in the right direction there too.

Jamie : Cool.

So lots and lots of different ways and folks who are listening in, I’ll get all of that written down, I’ll do some searching to get the URLs and I’ll put those all in the show notes so you don’t have to worry about, "what was it that Maddy said? How do I get in touch?" It’s all in the show notes, folks. That’s the thing I do for you.

Maddy : Wonderful. Thank you.

Jamie : Awesome. Yeah, I realized that it’s been a bit of a whistle stop tour with .NET MAUI. And I realize it’s been like some of them have been sort of beginner questions, Maddy. So I apologize for that. We didn’t get too deep into the weeds and sort of nerd out about it.

Maddy : No, that’s what I love.

Jamie : The "how it all fits together," and stuff.

Maddy : The more that we can get people started, the happier I am.

Jamie : Right. Cool.

Well, yeah. Thank you very much, Maddy, and I really appreciate it. I appreciate you spending some time with us today to figure out all of this stuff. There’s also the .NET MAUI GitHub repo as well, isn’t there? So people have got to, maybe they’ve encountered a bug specifically with .NET MAUI. And the think maybe they’re thinking, "this is actually a .NET MAUI problem. Here’s the situation I was in and here are what I expected and here’s what actually happened." They can report that there, right?

Maddy : Yes. That is the best place to go. Or in Visual Studio: "Help > Report a problem" in the menu.

Jamie : Cool. Okay. All awesome. Well, what I’ll say, Maddy, is thank you ever so much for your time this afternoon and I hope you enjoy the rest of your day.

Maddy : Yeah, you too. Thank you so much.

Wrapping Up

Thank you for listening to this episode of The Modern .NET Show with me, Jamie Taylor. I’d like to thank this episode’s guest, Maddy Montaquila, for graciously sharing her time, expertise, and knowledge.

Be sure to check out the show notes for a bunch of links to some of the stuff that we covered, and full transcription of the interview. The show notes, as always, can be found at the podcast's website, and there will be a link directly to them in your podcatcher.

And don’t forget to spread the word, leave a rating or review on your podcatcher of choice - head over to dotnetcore.show/review for ways to do that - reach out via our contact page, or join out discord server at dotnetcore.show/discord - all of which are linked in the show notes.

But above all, I hope you have a fantastic rest of your day, and I hope that I’ll see you again, next time for more .NET goodness.

I will see you again real soon. See you later folks.

Follow the show

You can find the show on any of these places