Categories
.NET .NET 8 .NET MAUI Android Blazor Code Desktop Developer Hybrid iOS Mobile MSBuild NuGet Quick Fix Templates Windows Xamarin

.NET MAUI 8 Service Releases

After the holidays, the first service release (SR1) of .NET MAUI on .NET 8 was released today. This release is published as a NuGet package rather than a workload update as it tries to address many of the issues faced with the GA release. The changelog is available here. So instead of doing an dotnet workload update, follow the steps given below to pull the latest version so the change is minimal and future-proof for the existing projects.

Both the official template and the All-in-One template pack refer to the version of .NET MAUI NuGet packages via the MSBuild property MauiVersion. This can be seen in the package reference node in the project file. Usually, this property is set by the Targets file available as part of the workload.

.NET MAUI NuGet Package Reference
.NET MAUI NuGet Package Reference

As already explained, the service releases are published only as a NuGet package for now, the version attribute of the package reference nodes has to be manually updated. But this is cumbersome if it’s a multi-project solution.

Instead, to make it error-free and future-proof, define the MauiVersion property with the service release version in the project file or in the Directory.Packages.props, if using the NuGet CPM feature. Refer to the screenshots below.

Service ReleaseVersion #
SR18.0.6
SR28.0.7
SR38.0.10
SR3.18.0.14
SR48.0.20
SR4.18.0.21
SR58.0.40
SR68.0.60
SR78.0.70
SR7.18.0.71
SR88.0.80
SR8.28.0.82
SR8.38.0.83
SR98.0.90
SR9.18.0.91
SR9.28.0.92
SR9.3 (latest)8.0.93
.NET MAUI 8 Service Releases

Project File:

Pro Tip: As service releases are now distributed as NuGet packages, updating the MauiVersion property dynamically as shown below is recommended to facilitate easier upgrades.

It is not feasible to accomplish floating package versions while utilizing NuGet CPM, as this format has yet to be supported.

<MauiVersion>8.*</MauiVersion>
MauiVersion MSBuild property
MauiVersion MSBuild property in the project file

Directory.Packages.props:

MauiVersion MSBuild property in props file
MauiVersion MSBuild property in the props file

If you’re working on a multi-project solution that uses MAUI on more than one project, then follow the same technique as CPM by creating a Directory.Packages.props file at the solution level and defining only this MauiVersion property as shown below instead of defining it in each of the project files which is definitely an overhead.

Sample shown for .NET MAUI 8 SR1:

Update the value to the corresponding service release version #; alternatively, use the dynamic version (8.*) to always retrieve the latest stable version.

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

PS: Once this is released as a regular workload update, comment out this MauiVersion property node so that it refers to its value from the refreshed Targets file as usual.

For newer projects, will publish an updated version of the All-in-One templates pack later today with this property included so that manual change is unnecessary. v5.0.0 is published. Update now.

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

By Vijay Anand E G

A software professional with over a decade long industry experience in developing products that spans across desktop, mobile, and web.

One reply on “.NET MAUI 8 Service Releases”

Comments are closed.

Discover more from Developer Thoughts

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

Continue reading