github dotnet/maui 9.0.0-rc.2.24503.2

pre-release17 hours ago

Product Fixes | Docs | Testing | Dependency Updates | Housekeeping | New Contributors | Known Issue(s)

What's Changed

Product Fixes

Docs

Testing

Dependency Updates

Housekeeping

New Contributors

Known Issues

Potential .NET MAUI Project Issues due to Changes in .NET SDK Windows Targets

Changes to some of the Windows targets in the .NET SDK may cause unexpected warnings or errors in .NET MAUI projects while the .NET MAUI workload is still built to work with WindowsAppSDK 1.5.x (see #25132 for more details on upstream issues). Warnings or errors you may see:

MVVMTKCFG0003 - This version of the MVVM Toolkit requires 'Microsoft.Windows.SDK.NET.Ref' version '10.0.19041.38' or later. Please update to .NET SDK 8.0.109, 8.0.305 or 8.0.402 (or later). Alternatively, use a temporary 'Microsoft.Windows.SDK.NET.Ref' reference, which can be done by setting the 'WindowsSdkPackageVersion' property in your .csproj file. For your project configuration, it is recommended to set the package version to '10.0.19041.41'.

Could not load file or assembly 'WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709'. The system cannot find the file specified.":"WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709

CS0433: The type 'TextDecorations' exists in both 'Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b' and 'Microsoft.Windows.SDK.NET, Version=10.0.20348.38, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

To fix these errors, you can add a property to your .csproj file:

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'"">
    <WindowsSdkPackageVersion>10.0.19041.38</WindowsSdkPackageVersion>
</PropertyGroup>

If you see an error similar to the one below, you will need to add a partial identifier to the class mentioned in the error due to a new analyzer detecting code which is not Native AOT compatible:

CsWinRT1028: Class 'MauiCommandBar' implements WinRT interfaces but isn't marked partial. Type should be marked partial for trimming and AOT compatibility if passed across the WinRT ABI.

These errors should be addressed in .NET 9 RTM / GA which should reference an updated version of WindowsAppSDK.

Full Changelog: 9.0.0-rc.1.24453.9...9.0.0-rc.2.24503.2

Don't miss a new maui release

NewReleases is sending notifications on new releases.