Categories
.NET .NET 8 .NET 9 .NET MAUI Android Blazor C# Desktop Developer Extensions F# General Getting Started Hybrid iOS macOS Mobile NuGet Templates Tools Visual Studio VS Code Web What's New Windows Xamarin Xamarin.Forms

What’s New in the All-in-One .NET MAUI Templates Pack v6.0

As the name suggests, has a slew of features under the hood to work with .NET MAUI.

To effectively support the stable release of .NET MAUI 9, both the CLI NuGet package and the Visual Studio extension of the All-in-One .NET MAUI Templates Pack have been fully updated.

An article has already been published detailing the comprehensive features of .NET MAUI 9.

To know more about the features of this template pack, consult the articles linked here.

Install:

From CLI:

Here’s the command to install the CLI templates pack.

dotnet new install VijayAnand.MauiTemplates

From VS2022:

To install as VSIX, download and install from Visual Studio Marketplace or use the Extension Manager (shortcut: Alt+X+M) from within the Visual Studio IDE, search with maui keyword with the Online/Browse  Tab in focus and look for .NET MAUI Project and Item Templates.

.NET MAUI Project and Item Templates - Visual Studio Extension
.NET MAUI Project and Item Templates – Visual Studio Extension

Key Features:

The following delineates the key features encompassed within this Series 6 release (command samples provided below):

  • Templates updated to support .NET MAUI 9 Stable channel release
    • The default value for the Framework parameter is now set to net9.0
    • This update applies to both the MAUI and Shared Library projects as well
    • So by default, the project command generates a .NET MAUI 9 project
  • To create a .NET MAUI 8 project, explicitly pass the value for the Framework parameter
  • Added support for Dynamic NuGet package versioning for .NET MAUI 9 (similar to that in .NET MAUI 8)
  • Removed unsupported versions (.NET MAUI 6 and 7) and Comet, as it is no longer being updated
  • For ease of use, the MAUI Community Toolkit and Syncfusion MAUI Toolkit’s XAML namespaces have been added to the App.xaml file, if opted
  • Support for Nightly build configuration has been extended for .NET MAUI 9 also
  • Wherever applicable, .NET MAUI 9 constructs are applied, such as referencing the Window's Page instead of the now deprecated Application's MainPage. For further details, refer to this article

CLI Commands:

To create a .NET MAUI 9 project:

dotnet new mauiapp -o MyApp

To create a .NET MAUI 8 project:

dotnet new mauiapp -o MyApp -f net8.0

Library Projects:

dotnet new mauiclasslib -o MauiLib
dotnet new sharedclasslib -o SharedLib

Support for NuGet Central Package Management (CPM) feature:

dotnet new mauiapp -o MyApp -cpm

With support for Nightly builds:

dotnet new mauiapp -o MyApp -ni

These project options may also be combined for practical scenarios.

Dynamic NuGet package reference for .NET MAUI:

With this dynamic approach, upgrading to the latest service release is effortless.

Please consult the Directory.Packages.props file, which is located adjacent to the solution file within the project root directory.

Note: This is not possible with the NuGet CPM feature enabled, as it does not yet support dynamic versioning. Please use the explicit version option as described below instead.

<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
    <MauiVersion>9.*</MauiVersion>
  </PropertyGroup>
</Project>

It also helps to stick to a particular (service) release, just update the MauiVersion node with an explicit release version. For example, .NET MAUI 9 SR1 9.0.10.

When the NuGet CPM option is enabled, the value for the MauiVersion node is set explicitly, and the ManagePackageVersionsCentrally node is set to true instead of false, along with the package references.

<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
    <MauiVersion>9.0.10</MauiVersion>
  </PropertyGroup>
</Project>

For VS2022/Rider IDE:

The Framework is a dropdown control populated with the supported versions of .NET 8 and .NET 9. It is imperative to select the appropriate version during the project creation process.

All those discussed options are presented as checkboxes for the developer to opt-in.

Help and Support:

dotnet new mauiapp -h

Documentation is available here. If you have any issues or features to suggest, please raise an issue with appropriate details here. Ideas are most welcome.

If you find these extensions useful, kindly support the work by adding your review to the VS Marketplace and also by adding a Star to the GitHub repository where it’s actively maintained. Also, share the word with your team and inner circle.

Much of my time is spent on adding new features to the templates pack if you want to recognize the work and sustain the momentum, kindly consider sponsoring on the GitHub Sponsor page or Buy Me a Coffee page. Thanks in advance.

Happy coding. Stay connected as we continue to learn and share the experiences from this exciting journey of being a .NET developer.

One reply on “What’s New in the All-in-One .NET MAUI Templates Pack v6.0”

Comments are closed.

Discover more from Developer Thoughts

Subscribe now to keep reading and get access to the full archive.

Continue reading