Skip to content

Commit b23943d

Browse files
authored
Merge pull request #266 from DuendeSoftware/wca/maui-net9
Updated Maui sample to .NET 9
2 parents 06ae5fd + 6f11945 commit b23943d

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
namespace MauiApp1;
1+
2+
namespace MauiApp1;
23

34
public partial class App : Application
45
{
5-
public App()
6-
{
7-
InitializeComponent();
6+
public App() => InitializeComponent();
87

9-
MainPage = new AppShell();
10-
}
8+
protected override Window CreateWindow(IActivationState? activationState) => new Window(new AppShell());
119
}

various/clients/Maui/MauiApp1/MauiApp1/MauiApp1.csproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7-
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
88

99
<!-- Note for MacCatalyst:
1010
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
@@ -19,7 +19,10 @@
1919
<SingleProject>true</SingleProject>
2020
<ImplicitUsings>enable</ImplicitUsings>
2121
<Nullable>enable</Nullable>
22-
22+
<!-- https://github.com/CommunityToolkit/Maui/issues/2205 -->
23+
<NoWarn>XC0103</NoWarn>
24+
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
25+
2326
<!-- Display name -->
2427
<ApplicationTitle>MauiApp1</ApplicationTitle>
2528

@@ -30,8 +33,11 @@
3033
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
3134
<ApplicationVersion>1</ApplicationVersion>
3235

33-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
34-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
36+
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
37+
<WindowsPackageType>None</WindowsPackageType>
38+
39+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
40+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
3541
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
3642
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
3743
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
@@ -60,7 +66,7 @@
6066
<PackageReference Include="Duende.IdentityModel.OidcClient" Version="6.0.1" />
6167
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
6268
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
63-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
69+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.11" />
6470
</ItemGroup>
6571

6672
</Project>

0 commit comments

Comments
 (0)