New .NET 9 Templates for Blazor Hybrid, .NET MAUI -- Visual Studio Magazine (2024)

News

New .NET 9 Templates for Blazor Hybrid, .NET MAUI

  • By David Ramel
  • 06/20/2024

Microsoft's fifth preview of .NET 9 nods at AI development while also introducing new templates for some of the more popular project types, including Blazor Hybrid and .NET MAUI.

Somehow neither the release notes nor the accompanying Preview 5 discussions contain the word "Copilot," but even so Microsoft managed to lead off Preview 5 news with "enhanced AI capabilities," basically more methods exposed by TensorPrimitives and Tensor<T> functionality.

"TensorPrimitives and the new Tensor<T> type expand AI capabilities by enabling efficient encoding, manipulation, and computation of multi-dimensional data," said Microsoft of tensors, described as multidimensional arrays that serve as the cornerstone data structure of AI development. Updated versions of these types are available in the latest prerelease version of the System.Numerics.Tensors package.

Meanwhile, new and updated templates are available for popular framework project types, including ASP.NET Core for web development and .NET MAUI for cross-platform mobile development. The latter also allows for desktop development, something not offered by its predecessor, Xamarin.Forms. Thus Preview 5 is headlined by a new template called ".NET MAUI Blazor Hybrid and Web App" solution, which makes it easier to create a .NET MAUI Blazor Hybrid app and a Blazor web app that share the same UI. Microsoft said the new template shows how to create apps that target Android, iOS, Mac, Windows and web while maximizing code reuse.

Key features of the new template include:


  • The ability to choose a Blazor interactive render mode for the web app.
  • Automatic creation of the appropriate projects, including a Blazor Web App and a .NET MAUI Blazor Hybrid app.
  • The created projects are wired up to use a shared Razor Class Library that contains all of the UI components and pages.
  • Sample code that demonstrates how to use service injection to provide different interface implementations for the Blazor Hybrid and Blazor Web App. In .NET 8 this is a manual process documented in Build a .NET MAUI Blazor Hybrid app with a Blazor Web App.

Using the new template requires Preview 5 or later of the .NET 9 SDK and the installation of the .NET MAUI workload in Visual Studio.

Other ASP.NET Core highlights include:

In addition to the updated Blazor Hybrid template, other assorted .NET MAUI tweaks in .NET 9 Preview 5 include:

On the data side of things, Microsoft noted an enhanced database provider for Azure Cosmos DB for NoSQL along with minor query translation improvements, specifically including:

  • Optimization of queries using Count != 0 or Count > 0
  • Null semantics for comparison operators
  • Translations for TimeOnly.FromDateTime and TimeOnly.FromTimeSpan

About the Author

David Ramel is an editor and writer for Converge360.

Printable Format

comments powered by Disqus

Featured

  • GitHub Copilot for Azure Gets Preview Glitches

    This reporter, recently accepted to preview GitHub Copilot for Azure, has thus far found the tool to be, well, glitchy.

  • New .NET 9 Templates for Blazor Hybrid, .NET MAUI

    Microsoft's fifth preview of .NET 9 nods at AI development while also introducing new templates for some of the more popular project types, including Blazor Hybrid and .NET MAUI.

  • What's Next for ASP.NET Core and Blazor

    Since its inception as an intriguing experiment in leveraging WebAssembly to enable dynamic web development with C#, Blazor has evolved into a mature, fully featured framework. Integral to the ASP.NET Core ecosystem, Blazor offers developers a unique combination of server-side rendering and rich client-side interactivity.

  • Nearest Centroid Classification for Numeric Data Using C#

    Here's a complete end-to-end demo of what Dr. James McCaffrey of Microsoft Research says is arguably the simplest possible classification technique.

  • .NET MAUI in VS Code Goes GA

    Visual Studio Code's .NET MAUI workload, which evolves the former Xamarin.Forms mobile-centric framework by adding support for creating desktop applications, has reached general availability.

Most Popular

  • Most Popular Articles
  • Most Emailed Articles

What's Next for ASP.NET Core and Blazor

New .NET 9 Templates for Blazor Hybrid, .NET MAUI

First Official OpenAI Library for .NET Goes Beta

GitHub Copilot for Azure Gets Preview Glitches

Nearest Centroid Classification for Numeric Data Using C#

New .NET 9 Templates for Blazor Hybrid, .NET MAUI -- Visual Studio Magazine (2024)

References

Top Articles
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 5380

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.