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

.NET MAUI All-in-One Templates Pack v5.6: NuGet CPM and Nightly Builds Support

Firstly, .NET MAUI 9 Preview 5 has just been released. The changelog can be found here. Notably, a new Blazor Hybrid Web template has been introduced in this version.

In short, this new template abstracts the Razor components into a distinct Razor Class Library (RCL). Furthermore, it provides the ability to create Blazor Web projects within the same solution and refers to the shared RCL.

The concept of abstracting the Razor components is already facilitated by the Hybrid project templates within the All-in-One template pack.

dotnet new mauiapp -o MyApp -dp Hybrid -rcl

Will review the modifications and cover them in a distinct article.

To acquire a deeper understanding of sharing Blazor components across AppModels, a thorough and operational solution can be accessed on GitHub here. The WebAssembly (PWA) version of the solution is hosted here.

The latest update of the All-in-One templates pack v5.6, has just been released. This iteration is filled with essential enhancements enhancing productivity and simplifying project setup.

To gain detailed insights into the functionalities of the All-in-One templates pack, please refer to these articles.

What’s New:

  • Introduced using the NuGet CPM feature from within Visual Studio IDE
  • Automated the process of using MAUI Nightly builds without any need for manual configuration with a local NuGet.config file
    • Just opt in for Nightly build and you’re ready to go
  • While abstracting the Shared components using the MAUI Class Library option, Directory.Packages.props file would get listed as a Solution Item to update the MauiVersion property at a later point in time
  • Templates updated for .NET MAUI 9 Preview 5 and .NET MAUI 8 SR6

NuGet CPM is an essential feature for teams working on a solution with multiple projects. It enables centralized management of package versions, thus alleviating the challenge of updating them in various locations and mitigating the risk of version mismatches between dependent projects.

The NuGet CPM feature was initially limited to the CLI due to challenges in incorporating the Directory.Packages.props in the same solution file. However, this limitation has been resolved, and the feature is now accessible within Visual Studio IDE itself. As a result, users no longer need to switch between the IDE and the terminal 😊.

.NET MAUI All-in-One Templates - Support for NuGet CPM and Nightly Builds
.NET MAUI All-in-One Templates – Support for NuGet CPM and Nightly Builds

David Ortinau emphasized the use of MAUI Nightly Builds in this month’s community standup. From v4.6 onwards, projects in the All-in-One templates pack already support the utilization of Nightly builds. However, configuring the package source from the CI feed requires manual steps, as elaborated in this article: .NET MAUI – Nightly Builds.

Nevertheless, there is a pressing need for automation. This v5.6 release streamlines the process by eliminating the manual setup steps in the package source configuration through the use of a local NuGet.config file (preconfigured). This ensures seamless functionality when selecting the Nightly builds option during project creation.

dotnet new mauiapp -o MyApp -ni

Note: The Nightly builds feature is currently only supported on .NET 8 (Stable channel). Selecting this option on any other target framework will not have any impact.

While opting to abstract the Shared components into a separate MAUI Class Library, a Directory.Packages.props file would be generated to accommodate the MauiVersion property. This enables the easy updating of the newer version # in a single location when upgrading to a newer service release. However, this file was not included as a Solution Item to be managed within the IDE itself (similar to the challenge faced with CPM). This issue has now been resolved, allowing for seamless management.

Finally, all the templates have been updated to support the latest releases.

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.

2 replies on “.NET MAUI All-in-One Templates Pack v5.6: NuGet CPM and Nightly Builds Support”

Comments are closed.

Discover more from Developer Thoughts

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

Continue reading