Categories
.NET .NET 8 .NET MAUI Android Blazor C# Desktop Developer DevOps Hybrid iOS macOS Mobile Templates Windows Xamarin Xamarin.Forms

.NET MAUI – Nightly Builds

At first, .NET 6 and .NET 7 versions of .NET MAUI were released only via SDK Workloads whereas from .NET 8 onwards (Preview 4 to be precise), it is now distributed as a base workload and suite of NuGet packages on top of it.

This NuGet-based release process allows trying different versions of .NET MAUI which are released on top of a base workload on the same machine without the complexities of moving between different workload versions.

This has been the case with both SR1 (v8.0.6) and SR2 (v8.0.7), the so-far published service releases for .NET MAUI 8. For more details on the seamless update to this service release, take a look at this article.

Most importantly, this has also opened up the possibility of using Nightly builds for those, like library authors, whose work depends on the CI builds as they want to develop/test their features as soon as they’re available on the main branch.

Manage Feed:

Unlike stable releases, the nightly builds are not published to NuGet rather they are hosted on Azure DevOps. Hence it is necessary to configure the package feed manually (identified by a name. For example, maui-nightly). Use the below command to do so. The package feed can be viewed online here.

dotnet nuget add source -n maui-nightly https://aka.ms/maui-nightly/index.json

Post this, check whether it’s getting listed as a package source:

dotnet nuget list source

Since the package names are one and the same, to work with a stable release without any disruption, disable the nightly build package source with the command shown below.

dotnet nuget disable source maui-nightly

And enable it when needed with this command.

dotnet nuget enable source maui-nightly

Since these nightly builds are made available on top of the base workload, an explicit definition of the MauiVersion property is required either on the Project file or in the Directory.Package.props file if using NuGet’s CPM feature to download and reference the appropriate package versions. The current version as of this writing is 8.0.10-nightly.10061

Templates Support:

The All-in-One templates pack supports this Nightly build feature out of the box from v4.6.0 or later.

To install:

dotnet new install VijayAnand.MauiTemplates

To create a .NET MAUI app with this Nightly build feature, add this CLI parameter -ni / --nightly and is supported on the library projects as well.

On the IDE, this is an Option checkbox made available just below the Target Platforms dropdown.

dotnet new mauiapp -o MyApp -ni

To use it along with the CPM feature.

dotnet new mauiapp -o MyApp -cpm -ni

Note: This nightly build feature as a whole is available only on .NET 8 (the stable release channel) for now. Using this parameter while creating projects for other target frameworks will not have any effect.

If you find these templates and 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 hosted. Also, share this article with your team, inner circle, and social media channels.

And a considerable amount of my time is spent on adding new features to the templates pack if you would like to recognize the work and sustain the momentum, kindly consider sponsoring the project in GitHub here. 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 “.NET MAUI – Nightly Builds”

Comments are closed.