Skip to content

Commit 8773b98

Browse files
committed
feat: Updated to net9
1 parent 93f3a3b commit 8773b98

File tree

20 files changed

+69
-54
lines changed

20 files changed

+69
-54
lines changed

.github/workflows/dotnet.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: '9.0.x'
1621

1722
- name: Install workloads
1823
run: dotnet workload install maui

src/apps/H.NotifyIcon.Apps.Console/H.NotifyIcon.Apps.Console.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net4.8;net8.0-windows</TargetFrameworks>
4+
<TargetFrameworks>net4.8;net9.0-windows</TargetFrameworks>
55
<OutputType>Exe</OutputType>
66
<LangVersion>preview</LangVersion>
77
<Nullable>enable</Nullable>

src/apps/H.NotifyIcon.Apps.Maui/App.xaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ public partial class App : Application
55
public App()
66
{
77
InitializeComponent();
8-
9-
MainPage = new AppShell();
108
}
9+
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new AppShell());
13+
}
1114
}

src/apps/H.NotifyIcon.Apps.Maui/H.NotifyIcon.Apps.Maui.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>$(TargetFrameworks);net8.0-maccatalyst</TargetFrameworks> <!-- net8.0-android;net8.0-ios; -->
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>$(TargetFrameworks);net9.0-maccatalyst</TargetFrameworks> <!-- net9.0-android;net9.0-ios; -->
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.
@@ -30,8 +30,8 @@
3030
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
3131
<ApplicationVersion>1</ApplicationVersion>
3232

33-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
34-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
33+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">12.2</SupportedOSPlatformVersion>
34+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
3535
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
3636
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
3737
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
@@ -58,11 +58,9 @@
5858

5959
<ItemGroup>
6060
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
61-
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
6261
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
6362
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
64-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
65-
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="2.88.9" />
63+
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="3.116.1" />
6664
</ItemGroup>
6765

6866
<ItemGroup>

src/apps/H.NotifyIcon.Apps.Maui/MainPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public MainPage()
1717
[RelayCommand]
1818
public void ShowHideWindow()
1919
{
20-
var window = Application.Current?.MainPage?.Window;
20+
var window = Application.Current?.Windows[0];
2121
if (window == null)
2222
{
2323
return;

src/apps/H.NotifyIcon.Apps.WinUI.Windowless/H.NotifyIcon.Apps.WinUI.Windowless.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net8.0-windows10.0.18362.0</TargetFramework>
5+
<TargetFramework>net9.0-windows10.0.18362.0</TargetFramework>
66
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
77
<Platforms>x86;x64;arm64</Platforms>
88
<UseWinUI>true</UseWinUI>
@@ -22,8 +22,8 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
26-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240627000" />
25+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
26+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
2727
</ItemGroup>
2828

2929
<ItemGroup>

src/apps/H.NotifyIcon.Apps.WinUI/H.NotifyIcon.Apps.WinUI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
26-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
27-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240627000" />
25+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
26+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
27+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
2828
</ItemGroup>
2929

3030
<ItemGroup>

src/apps/H.NotifyIcon.Apps.Wpf.Windowless/H.NotifyIcon.Apps.Wpf.Windowless.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net4.6.2;net8.0-windows</TargetFrameworks>
5+
<TargetFrameworks>net4.6.2;net9.0-windows</TargetFrameworks>
66
<UseWPF>true</UseWPF>
77
<LangVersion>preview</LangVersion>
88
<Nullable>enable</Nullable>

src/apps/H.NotifyIcon.Apps.Wpf/H.NotifyIcon.Apps.Wpf.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFrameworks>net4.6.2;net8.0-windows</TargetFrameworks>
5+
<TargetFrameworks>net4.6.2;net9.0-windows</TargetFrameworks>
66
<UseWPF>true</UseWPF>
77
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
88
<LangVersion>preview</LangVersion>

src/apps/TrimmingHelper/TrimmingHelper.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<PublishTrimmed>true</PublishTrimmed>
77
<!-- <TrimMode>full</TrimMode> -->
88
<ImplicitUsings>enable</ImplicitUsings>
@@ -15,6 +15,7 @@
1515

1616
<ItemGroup>
1717
<TrimmerRootAssembly Include="H.NotifyIcon" />
18+
<TrimmerRootAssembly Include="H.GeneratedIcons.System.Drawing" />
1819
</ItemGroup>
1920

2021
<PropertyGroup Label="Publish">

0 commit comments

Comments
 (0)