Skip to content

Commit ed8dd92

Browse files
TheCodeTravelerne0rrmatrixJoonghyunCho
authored
Add .NET 10 Support (#2902)
* Update to .NET 10 * Update CSharpCodeFixVerifier`2+Test.cs * Fix Unit Test * Update Verifiers * Downgrade `Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net` * Keep Compiler Error for `Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net` * Update Directory.Build.props * Remove AOT * Update to .NET 10 RC 2 * Update NuGet Packages * Update NuGet packages * Remove `[RequiresUnreferencedCode]` * Remove `<NoWarn>CsWinRT1028` * Increase to JDK 21 * Remove `NextMauiPackageVersion` This should no longer be necessary now that we don't have internal access to MAUI * sample apps builds * Update for .NET MAUI compatibility and .NET 10 support - Added conditional compilation for .NET 10 in `CSharpAnalyzerVerifier`. - Updated `XmlnsDefinition` attributes for .NET MAUI compatibility. - Upgraded `Xamarin.AndroidX.Media3` packages to version 1.8.0. - Added `using` directives for `Microsoft.Maui` namespaces across files. - Adjusted platform-specific code to use updated APIs (e.g., `session.PlatformToken`). - Included Android resource `textureview.xml` in the project. * Temp fix for `AllowMissingPrunePackageData` to true * Add `AllowMissingPrunePackageData` to resolve issues. This will need to be removed before shipping. * Fix Tizen `IDisposable` in CamerViewHandler * Fix Tizen? * Adopt Xaml Source Generation * Fix `Microsoft.Extensions.Logging.Debug` dependency * Fix Nullable Type Errors * Build `CommunityToolit.Maui.csproj` instead of `CommunityToolkit.Maui.sln` This will allow us to isolate build errors in the pipeline currently being caused by `CommunityToolit.Maui.Analyzers.UnitTests` * Fix .NET 10 Warnings * Fix Tizen build errors for upgrading NET10 (#2928) * `dotnet format` * Add Latest NuGet Version * Fix namespace * FixTizen Build Errors * Add `new` keyword functionality to `BindablePropertyAttributeSourceGenerator` * Update BadgeImplementation.tizen.cs * Add Fix for Android StatusBarBehavior on Android 35 #2533 (comment) * Update NuGet Packages * Remove NuGet Package References Fixing Vulnerabilities * Fix OnPlatform not working with nested Bindings by nesting OnPlatform in AppThemeBinding instead of the other way around * Update Main.cs * Use `TestContext.Current.CancellationToken` * Update Main.cs * Convert `sln` -> `slnx` * Update Build to Workaround .NET 10 errors * Use `macos-26` * Revert `preview` * Use `ga` * Use `macos26` * Remove Obsolete attribute from BasePage constructor Removed the Obsolete attribute from the BasePage constructor. * Update dotnet-build.yml * `dotnet format` * Change Button_Clicked to async for URL loading * Remove Obsolete attribute from ConvertersGalleryViewModel Removed the Obsolete attribute from ConvertersGalleryViewModel. * Update Microsoft.Maui.Controls package reference version * Update MauiPackageVersion to 10.0.0 * Update LangVersion from 'preview' to 'latest' * Remove `[Obsolete]` * Revert `Microsoft.CodeAnalysis.CSharp` NuGet Packages to latest stable release * Remove `[Obsolete]` * Set `<IncludeTizenTargetFrameworks>true</IncludeTizenTargetFrameworks>` to false * Update NuGet Packages, Fix Build Errors * Use `Assert. ThrowsAnyAsync` --------- Co-authored-by: James Crutchley <[email protected]> Co-authored-by: Jay Cho <[email protected]>
1 parent dd41a69 commit ed8dd92

File tree

157 files changed

+810
-3090
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+810
-3090
lines changed

.github/workflows/benchmarks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- '*'
1414

1515
env:
16-
LATEST_NET_VERSION: '9.0.x'
16+
LATEST_NET_VERSION: '10.0.x'
1717
PathToCommunityToolkitAnalyzersBenchmarkCsproj: 'src/CommunityToolkit.Maui.Analyzers.Benchmarks/CommunityToolkit.Maui.Analyzers.Benchmarks.csproj'
1818

1919
concurrency:
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
os: [windows-latest, macos-15]
30+
os: [windows-latest, macos-26]
3131

3232
steps:
3333
- name: Checkout code

.github/workflows/dotnet-build.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ env:
2222
NugetPackageVersionCamera: '99.0.0-preview${{ github.run_number }}'
2323
NugetPackageVersionMediaElement: '99.0.0-preview${{ github.run_number }}'
2424
NugetPackageVersionMaps: '99.0.0-preview${{ github.run_number }}'
25-
TOOLKIT_NET_VERSION: '9.0.306'
26-
LATEST_NET_VERSION: '9.0.x'
27-
PathToLibrarySolution: 'src/CommunityToolkit.Maui.sln'
28-
PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Sample.sln'
25+
TOOLKIT_NET_VERSION: '10.0.100'
26+
LATEST_NET_VERSION: '10.0.x'
27+
PathToLibrarySolution: 'src/CommunityToolkit.Maui.slnx'
28+
PathToSamplesSolution: 'samples/CommunityToolkit.Maui.Sample.slnx'
2929
PathToCommunityToolkitCsproj: 'src/CommunityToolkit.Maui/CommunityToolkit.Maui.csproj'
3030
PathToCommunityToolkitCoreCsproj: 'src/CommunityToolkit.Maui.Core/CommunityToolkit.Maui.Core.csproj'
3131
PathToCommunityToolkitCameraCsproj: 'src/CommunityToolkit.Maui.Camera/CommunityToolkit.Maui.Camera.csproj'
@@ -56,7 +56,7 @@ jobs:
5656
strategy:
5757
fail-fast: false
5858
matrix:
59-
os: [windows-latest, macos-15]
59+
os: [windows-latest, macos-26]
6060
steps:
6161
- name: Checkout code
6262
uses: actions/checkout@v5
@@ -76,7 +76,7 @@ jobs:
7676
- uses: actions/setup-java@v5
7777
with:
7878
distribution: 'microsoft'
79-
java-version: '17'
79+
java-version: '21'
8080

8181
- name: Install .NET MAUI Workload
8282
run: |
@@ -101,7 +101,7 @@ jobs:
101101
strategy:
102102
fail-fast: false
103103
matrix:
104-
os: [windows-latest, macos-15]
104+
os: [windows-latest, macos-26]
105105
steps:
106106
- name: Checkout code
107107
uses: actions/checkout@v5
@@ -203,12 +203,13 @@ jobs:
203203
run: dotnet build ${{ env.PathToCommunityToolkitCoreCsproj }} -c Release -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }}
204204

205205
- name: 'Build CommunityToolkit.Maui'
206-
run: dotnet build ${{ env.PathToLibrarySolution }} -c Release -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }}
206+
run: dotnet build ${{ env.PathToCommunityToolkitCsproj }} -c Release -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }}
207207

208-
- name: Run CommunityToolkit Analyzers UnitTests
209-
run: |
210-
cd ${{ env.PathToCommunityToolkitAnalyzersUnitTestProjectDirectory }}
211-
dotnet run -c Release --results-directory "${{ runner.temp }}" --coverage --coverage-output "${{ runner.temp }}/ut-analyzers.cobertura.xml" --coverage-output-format cobertura --report-xunit
208+
# Uncomment this step once Microsoft releases Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net100
209+
# - name: Run CommunityToolkit Analyzers UnitTests
210+
# run: |
211+
# cd ${{ env.PathToCommunityToolkitAnalyzersUnitTestProjectDirectory }}
212+
# dotnet run -c Release --results-directory "${{ runner.temp }}" --coverage --coverage-output "${{ runner.temp }}/ut-analyzers.cobertura.xml" --coverage-output-format cobertura --report-xunit
212213

213214
- name: Run CommunityToolkit UnitTests
214215
run: |

Directory.Build.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Nullable>enable</Nullable>
55
<NoWarn>NETSDK1023</NoWarn>
6-
<NetVersion>net9.0</NetVersion>
6+
<NetVersion>net10.0</NetVersion>
77
<LangVersion>preview</LangVersion>
88
<ImplicitUsings>enable</ImplicitUsings>
99
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
@@ -16,10 +16,11 @@
1616
<NuGetAuditMode>all</NuGetAuditMode>
1717

1818
<!-- MAUI Specific -->
19-
<MauiPackageVersion>9.0.120</MauiPackageVersion>
19+
<MauiPackageVersion>10.0.0</MauiPackageVersion>
2020
<MauiStrictXamlCompilation>true</MauiStrictXamlCompilation>
2121
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
2222
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
23+
<MauiXamlInflator>SourceGen</MauiXamlInflator>
2324

2425
<!-- WindowsAppSDK
2526
We should keep this in sync with .NET MAUI https://github.com/dotnet/maui/blob/8ee00e00f603cd8a420a3467daddaf3935c8c587/Directory.Build.props#L142
@@ -202,7 +203,7 @@
202203
IL2090,IL2091,IL2092,IL2093,IL2094,IL2095,IL2096,IL2097,IL2098,IL2099,
203204
IL2100,IL2101,IL2102,IL2103,IL2104,IL2105,IL2106,IL2107,IL2108,IL2109,
204205
IL2110,IL2111,IL2112,IL2113,IL2114,IL2115,IL2116,IL2117,IL2118,IL2119,
205-
IL2120,IL2121,IL2122,
206+
IL2120,IL2121,IL2122,IL2123,
206207
IL3050,IL3051,IL3052,IL3053,IL3054,IL3055,IL3056,
207208
RS1038,RS2007
208209
</WarningsAsErrors>
@@ -237,6 +238,7 @@
237238
</ItemGroup>
238239

239240
<PropertyGroup Condition="('$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true') and $([MSBuild]::IsOSPlatform('windows')) == 'true'">
240-
<IncludeTizenTargetFrameworks>true</IncludeTizenTargetFrameworks>
241+
<!-- Re-enable Tizen once it includes support for .NET 10 -->
242+
<IncludeTizenTargetFrameworks>false</IncludeTizenTargetFrameworks>
241243
</PropertyGroup>
242244
</Project>

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": "9.0.306",
3+
"version": "10.0.100",
44
"rollForward": "latestFeature",
55
"allowPrerelease": false
66
}

samples/CommunityToolkit.Maui.Sample.sln

Lines changed: 0 additions & 157 deletions
This file was deleted.

0 commit comments

Comments
 (0)