From the course: Creating .NET MAUI Applications with Blazor

When is a .NET MAUI Blazor app a good choice? - .NET MAUI Tutorial

From the course: Creating .NET MAUI Applications with Blazor

When is a .NET MAUI Blazor app a good choice?

- [Instructor] If we can make Blazor apps or websites that can run in a client browser and on the server, and we can also make MAUI apps that can work like normal client apps, the question becomes: Why would we ever want to combine these two technologies? To answer that question, we should take a look at what each of these technologies do for us individually. A Blazor app supports many different scenarios. It can primarily run on the server. It can also run on the client using WebAssembly. In fact, it can even run on the client completely offline using PWA technologies. Normally, Blazor apps can support most web application scenarios with a much easier deployment story than most client applications. Just as importantly, it can do it using WebAssembly on the client side and run languages such as C#, which is a much faster than interpreted JavaScript. If your team already has C# and web development knowledge, then Blazor might be attractive right off the bat. With Blazor, we get NAP that can run on many platforms in a browser and do it using very flexible and well-known HTML/CSS technologies, which many organizations already have invested significant time and energy in. On the other hand, MAUI strengths are that it makes real client-side apps that can be deployed in different app stores and has access to device APIs. Like Blazor, it can be written in C# and supports many different client platforms, though not through a browser. There is some overlap in knowledge needed and possible reasons to use. Unlike Blazor apps, it doesn't use HTML and CSS but instead uses the device's native UI technologies to render its screens. We do have overlap in the technologies and some differences. Why would both be used together? I can see a few scenarios where this would be beneficial. The first reason is based on the team skillset. If your team has a lot of HTML/CSS and C# capabilities, but the use case requires an app that is a store app and needs more access to devices APIs than web technologies provide, using Blazor in MAUI looks very attractive. Sometimes the business case may need a website and client applications that have substantial UI and feature overlap. A Blazor MAUI app can share substantial portions of its UI and logic with a Blazor web app. Perhaps you may just need a few existing web pages in a new app. Blazor MAUI apps can give us that too. Finally, some small portions of the MAUI Blazor app may be able to be redeployed without putting a new version of the app in the store. This brings some of the ease of web app deployment to fat client applications. However, there are some substantial limitations on doing this that we will discuss in a later chapter. If you find yourself in one of these scenarios, it is worth considering if a Blazor MAUI app may be a good solution to the problem.

Contents