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

  • Microsoft Revamps Fledgling AutoGen Framework for Agentic AI

    Only at v0.4, Microsoft's AutoGen framework for agentic AI -- the hottest new trend in AI development -- has already undergone a complete revamp, going to an asynchronous, event-driven architecture.

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

Subscribe on YouTube