Hosting a Blazor Application in WinUI
Blazor is a web framework from Microsoft that allows .NET developers to create C# web applications with little to no JavaScript code. Server-side Blazor applications were introduced with ASP.NET Core 3.0, and ASP.NET Core 3.2 added the ability to create client-side Blazor web apps with WebAssembly (Wasm). Wasm (https://webassembly.org/) allows runtimes such as .NET and Java to run in web applications in the browser, and it is supported by all modern browser engines. By leveraging the WebView2
control in WinUI 3, Windows developers can run a cloud-hosted Blazor application inside their WinUI client application. These options are changing a bit in .NET 8 with the introduction of rendering modes. We’ll discuss these new modes and the advantages of each.
In this chapter, we will cover the following topics:
- Learning some basics of client-side .NET development with ASP.NET Core and Blazor
- Creating a new Blazor application with Visual...