Skip to content

Commit 3833ea3

Browse files
Update to .NET 9
1 parent 694ba6d commit 3833ea3

File tree

6 files changed

+27
-23
lines changed

6 files changed

+27
-23
lines changed

.github/workflows/maui.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v1
1717

18-
- name: Setup .NET v8.0
18+
- name: Setup .NET v9.0
1919
uses: actions/setup-dotnet@v3
2020
with:
21-
dotnet-version: "8.0.x"
21+
dotnet-version: "9.0.x"
2222

2323
- name: Install .NET MAUI Workload
2424
run: |
@@ -30,18 +30,18 @@ jobs:
3030
3131
- name: Build Android App
3232
run: |
33-
dotnet build ./src -f net8.0-android
33+
dotnet build ./src -f net9.0-android
3434
3535
Build_iOS:
3636
runs-on: macos-14
3737

3838
steps:
3939
- uses: actions/checkout@v1
4040

41-
- name: Setup .NET v8.0
41+
- name: Setup .NET v9.0
4242
uses: actions/setup-dotnet@v3
4343
with:
44-
dotnet-version: "8.0.x"
44+
dotnet-version: "9.0.x"
4545

4646
- name: Install .NET MAUI Workload
4747
run: |
@@ -58,18 +58,18 @@ jobs:
5858

5959
- name: Build iOS App
6060
run: |
61-
dotnet build ./src -f net8.0-ios
61+
dotnet build ./src -f net9.0-ios
6262
6363
Build_MacCatalyst:
6464
runs-on: macos-14
6565

6666
steps:
6767
- uses: actions/checkout@v1
6868

69-
- name: Setup .NET v8.0
69+
- name: Setup .NET v9.0
7070
uses: actions/setup-dotnet@v3
7171
with:
72-
dotnet-version: "8.0.x"
72+
dotnet-version: "9.0.x"
7373

7474
- name: Install .NET MAUI Workload
7575
run: |
@@ -86,7 +86,7 @@ jobs:
8686

8787
- name: Build macOS App
8888
run: |
89-
dotnet build ./src -f net8.0-maccatalyst
89+
dotnet build ./src -f net9.0-maccatalyst
9090
9191
Build_Windows:
9292
runs-on: windows-latest
@@ -97,12 +97,12 @@ jobs:
9797
- uses: actions/setup-java@v2
9898
with:
9999
distribution: 'microsoft'
100-
java-version: '11'
100+
java-version: '17'
101101

102-
- name: Setup .NET v8.0
102+
- name: Setup .NET v9.0
103103
uses: actions/setup-dotnet@v3
104104
with:
105-
dotnet-version: "8.0.x"
105+
dotnet-version: "9.0.x"
106106

107107
- name: Install .NET MAUI Workload
108108
run: |

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Nullable>enable</Nullable>
55
<NoWarn>NETSDK1023</NoWarn>
6-
<NetVersion>net8.0</NetVersion>
6+
<NetVersion>net9.0</NetVersion>
77
<LangVersion>latest</LangVersion>
88
<ImplicitUsings>enable</ImplicitUsings>
99
<WarningsAsErrors>nullable</WarningsAsErrors>

src/HackerNews/App.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
using CommunityToolkit.Maui.Markup;
2-
using Microsoft.Maui.Controls;
1+
using CommunityToolkit.Maui.Markup;
32

43
namespace HackerNews;
54

65
class App : Application
76
{
8-
public App(AppShell appshell)
7+
readonly AppShell _appShell;
8+
9+
public App(AppShell appShell)
910
{
11+
_appShell = appShell;
12+
1013
Resources = new ResourceDictionary()
1114
{
1215
new Style<Shell>(
@@ -21,7 +24,7 @@ public App(AppShell appshell)
2124
(NavigationPage.BarTextColorProperty, ColorConstants.NavigationBarTextColor),
2225
(NavigationPage.BarBackgroundColorProperty, ColorConstants.NavigationBarBackgroundColor)).ApplyToDerivedTypes(true)
2326
};
24-
25-
MainPage = appshell;
2627
}
28+
29+
protected override Window CreateWindow(IActivationState? activationState) => new(_appShell);
2730
}

src/HackerNews/HackerNews.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<ApplicationVersion>1</ApplicationVersion>
1818

19-
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-ios'))">14.2</SupportedOSPlatformVersion>
20-
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-maccatalyst'))">14.0</SupportedOSPlatformVersion>
21-
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-android'))">21.0</SupportedOSPlatformVersion>
19+
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-ios'))">17.0</SupportedOSPlatformVersion>
20+
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-maccatalyst'))">15.0</SupportedOSPlatformVersion>
21+
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-android'))">25.0</SupportedOSPlatformVersion>
2222
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
2323
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
2424

src/HackerNews/Pages/ShellRenderer.macios.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ public override CGRect Frame
419419

420420
public override void LayoutSubviews()
421421
{
422-
if (Height is null or 0)
422+
if (Height is null or 0
423+
&& Superview is not null)
423424
{
424425
UpdateFrame(Superview);
425426
}

src/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.100",
3+
"version": "9.0.203",
44
"rollForward": "latestFeature"
55
}
66
}

0 commit comments

Comments
 (0)