Skip to content

9.0.0-rc.2.24503.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@rmarinho rmarinho released this 08 Oct 12:05
· 1 commit to release/9.0.1xx-rc2 since this release
8c61eed

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

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.

Warning changes (XAML)

Starting wih net9.0, we know show warnings for bindings in XAML that could be compiled, but aren't.
The warning code is XC0022. Compiling bindings by annotating them, or their parent with x:DataType produce more efficient code, and allow NativeAOT for your app.

You can suppress those warnings with XC0022 in your .csproj.

More info at https://learn.microsoft.com/dotnet/maui/fundamentals/data-binding/compiled-bindings


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