- Notifications
You must be signed in to change notification settings - Fork1.9k
Migrating from Preview 9 to 10
David Ortinau edited this pageNov 4, 2021 ·6 revisions
Windows is now supported by default. Update the Windows references:
<PropertyGroup><TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks><TargetFrameworksCondition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>...</PropertyGroup>
Replace your Windows package references with the these two:
<ItemGroupCondition="$(TargetFramework.Contains('-windows'))"><!-- Required - WinUI does not yet have buildTransitive for everything--><PackageReferenceInclude="Microsoft.WindowsAppSDK"Version="1.0.0-preview3" /><PackageReferenceInclude="Microsoft.Graphics.Win2D"Version="1.0.0.29-preview3" /></ItemGroup>
UpdateSupportedOSPlatformVersion
and add newTargetPlatformMinVersion
in the first<PropertyGroup>
.
<SupportedOSPlatformVersionCondition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion><TargetPlatformMinVersionCondition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
Update the RuntimeIdentifier:
<PropertyGroupCondition="$(TargetFramework.Contains('-windows'))"><OutputType>WinExe</OutputType><RuntimeIdentifier>win10-x64</RuntimeIdentifier></PropertyGroup>
For the app icon, update your<MauiImage IsAppIcon="True">
to use the new type<MauiIcon />
.
<MauiIconInclude="Resources\appicon.svg"ForegroundFile="Resources\appiconfg.svg"Color="#512BD4" />
Our new templates have now adopted .NET 6-isms such asglobal using andscoped namespaces.