News

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.

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.

.NET MAUI Blazor Hybrid and Web App
[Click on image for larger view.] ".NET MAUI Blazor Hybrid and Web App" (source: Microsoft).

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 at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube