Repository navigation
chore: try building and testing against .NET 10 - #23332
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Uno’s build/test infrastructure and template fixtures to exercise .NET 10 as the new “current” .NET version, and addresses new ILLink/trimming analyzer warnings triggered by the upgrade (mostly by adding DynamicallyAccessedMembers annotations and UnconditionalSuppressMessage).
Changes:
- Switch CI/test scripts and template smoke tests to target/install .NET 10.
- Update SolutionTemplate projects to
net10.0*TFMs (including WinAppSDK/Windows SDK ref versions). - Add trimming-related annotations/suppressions across runtime tests, SamplesApp code, source generators, and RemoteControl reflection paths.
Reviewed changes
Copilot reviewed 84 out of 84 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Navigation/NavigationHistory.mux.cs | Annotates Type.GetType() usage for trimming. |
| src/Uno.UI/Helpers/TypeMappings.cs | Adds trimming suppression on TryGetValue flow. |
| src/Uno.UI.RuntimeTests/Uno.UI.RuntimeTests.netcoremobile.csproj | Adds ILLink warning suppression for runtime tests build. |
| src/Uno.UI.RuntimeTests/UITests/_Engine/UnoUITests/Helpers/QueryExtensions.cs | Refactors reflected DP lookup and suppresses trimming warning. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_FrameworkElement_And_Leak.cs | Adds trimming suppressions for reflection-heavy test code; updates comments. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_Control.cs | Adds trimming suppressions for reflection over control types. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_BackgroundTransition.cs | Adds DynamicallyAccessedMembers + “preserve metadata” pattern for DataRow types. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Markup/Given_XamlReader.cs | Wraps Activator.CreateInstance and suppresses trimming warnings. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_BrowserKeyboardInputSource.cs | Uses assembly-qualified Type.GetType lookup for wasm input source. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Data/Given_Convert.cs | Wraps TypeDescriptor.GetConverter() with trimming suppressions. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_Control_Visibility.cs | Adds trimming suppressions for reflection-heavy control enumeration. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_ContentControl.cs | Adds activatable-type wrapper + preserve-metadata pattern for trimming. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_Button.cs | Adds DynamicallyAccessedMembers annotations for reflected instantiation. |
| src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/SplitButton/SplitButtonPage.xaml.cs | Uses new AssertSetControlType<T> helper for trimming-safe metadata. |
| src/Uno.UI.RuntimeTests/MUX/Microsoft_UI_Xaml_Controls/SplitButton/ControlStateViewer.xaml.cs | Adds DynamicallyAccessedMembers and AssertSetControlType<T>. |
| src/Uno.UI.RuntimeTests/MUX/Input/KeyboardAccelerators/KeyboardAcceleratorTestDiagnostics.cs | Adds DynamicallyAccessedMembers to generic sender type. |
| src/Uno.UI.RuntimeTests/MUX/Helpers/EventTester.cs | Adds sender-type trimming annotations and trims reflection helpers. |
| src/Uno.UI.RuntimeTests/Helpers/TimeZoneModifier.cs | Refactors reflection accessors with trimming suppressions. |
| src/Uno.UI.RemoteControl/HotReload/ClientHotReloadProcessor.MetadataUpdate.cs | Suppresses trimming warnings for Hot Reload-only reflection paths. |
| src/Uno.UI.RemoteControl/Helpers/ApplicationInfoHelper.cs | Suppresses trimming warnings for Remote Control helper. |
| src/Uno.UI.RemoteControl.DevServer.Tests/Fixtures/AddInWithCrossMajorVersionRefs/AddInWithCrossMajorVersionRefs.csproj | Moves fixture to net10.0 and updates package versions. |
| src/SourceGenerators/Uno.UI.SourceGenerators/BindableTypeProviders/BindableTypeProvidersGenerationTask.cs | Emits extra trimming suppressions for generated property setters. |
| src/SourceGenerators/System.Xaml/System.Xaml/XamlWriterStateManager.cs | Adds DynamicallyAccessedMembers annotations to generic exception types. |
| src/SourceGenerators/System.Xaml/System.Xaml/XamlType.cs | Adds trimming suppressions for reflection usage. |
| src/SourceGenerators/System.Xaml/System.Xaml/XamlSchemaContext.cs | Adds trimming annotations to value converter creation paths. |
| src/SourceGenerators/System.Xaml/System.Xaml/XamlObjectWriter.cs | Suppresses trimming warnings on reflection-based event/property setting. |
| src/SourceGenerators/System.Xaml/System.Xaml/XamlObjectNodeIterator.cs | Adds trimming suppression for reflection access. |
| src/SourceGenerators/System.Xaml/System.Xaml/XamlMember.cs | Adds trimming suppression around type converter lookup. |
| src/SourceGenerators/System.Xaml/System.Xaml/TypeExtensionMethods.cs | Adds trimming suppressions for reflection helpers. |
| src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlValueConverter.cs | Adds trimming annotations and suppression for converter instantiation. |
| src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlTypeInvoker.cs | Adds trimming suppressions for reflection-heavy invoker. |
| src/SourceGenerators/System.Xaml/System.Windows.Markup/ValueSerializer.cs | Suppresses trimming warning in serializer lookup path. |
| src/SourceGenerators/System.Xaml/System.Windows.Markup/StaticExtension.cs | Suppresses trimming warning for reflection. |
| src/SourceGenerators/System.Xaml/Assembly/Class1.cs | Adds local definitions for trimming-related attributes/types. |
| src/SourceGenerators/SourceGeneratorHelpers/Helpers/AnalyzerSuppressions.cs | Emits trimming suppressions for generated code (currently gated on NET9_0). |
| src/SolutionTemplate/UnoAppWinUILinuxValidation/UnoAppWinUILinuxValidation/UnoAppWinUILinuxValidation.csproj | Moves template to net10.0 TFMs + updates Windows SDK ref versions. |
| src/SolutionTemplate/UnoAppWinUILinuxValidation/UnoAppWinUILinuxValidation.Windows/UnoAppWinUILinuxValidation.Windows.csproj | Moves Windows head to net10.0-windows. |
| src/SolutionTemplate/UnoAppWinUILinuxValidation/UnoAppWinUILinuxValidation.Wasm/UnoAppWinUILinuxValidation.Wasm.csproj | Moves Wasm head to net10.0. |
| src/SolutionTemplate/UnoAppWinUILinuxValidation/UnoAppWinUILinuxValidation.Skia.Linux.FrameBuffer/UnoAppWinUILinuxValidation.Skia.Linux.FrameBuffer.csproj | Moves FrameBuffer head to net10.0. |
| src/SolutionTemplate/UnoAppWinUILinuxValidation/UnoAppWinUILinuxValidation.Server/UnoAppWinUILinuxValidation.Server.csproj | Moves server head to net10.0. |
| src/SolutionTemplate/UnoAppWinUI/UnoAppWinUI/UnoAppWinUI.csproj | Moves template TFMs to net10.0 + updates Windows SDK ref versions. |
| src/SolutionTemplate/UnoAppWinUI/UnoAppWinUI.Windows/UnoAppWinUI.Windows.csproj | Moves Windows head to net10.0-windows. |
| src/SolutionTemplate/UnoAppWinUI/UnoAppWinUI.Wasm/UnoAppWinUI.Wasm.csproj | Moves Wasm head to net10.0. |
| src/SolutionTemplate/UnoAppWinUI/UnoAppWinUI.Skia.WPF/UnoAppWinUI.Skia.WPF.csproj | Moves WPF head to net10.0-windows. |
| src/SolutionTemplate/UnoAppWinUI/UnoAppWinUI.Skia.Linux.FrameBuffer/UnoAppWinUI.Skia.Linux.FrameBuffer.csproj | Moves FrameBuffer head to net10.0. |
| src/SolutionTemplate/UnoAppWinUI/UnoAppWinUI.Server/UnoAppWinUI.Server.csproj | Moves server head to net10.0. |
| src/SolutionTemplate/UnoAppWinUI/UnoAppWinUI.Mobile/UnoAppWinUI.Mobile.csproj | Moves mobile TFMs to net10.0 and updates SupportedOSPlatformVersion values. |
| src/SolutionTemplate/MyUnoLib2/MyUnoLib2.csproj | Moves library template TFMs to net10.0. |
| src/SolutionTemplate/MyUnoLib/MyUnoLib.csproj | Moves library template TFMs to net10.0. |
| src/SolutionTemplate/MyCrossRuntimeLib/MyCrossRuntimeLib/MyCrossRuntimeLib.Wasm.csproj | Moves cross-runtime Wasm project to net10.0. |
| src/SolutionTemplate/MyCrossRuntimeLib/MyCrossRuntimeLib/MyCrossRuntimeLib.Skia.csproj | Moves cross-runtime Skia project to net10.0. |
| src/SolutionTemplate/MyCrossRuntimeLib/MyCrossRuntimeLib/MyCrossRuntimeLib.csproj | Moves cross-runtime library TFMs to net10.0. |
| src/SolutionTemplate/MyAppXamlTrim/MyAppXamlTrim.Wasm/MyAppXamlTrim.Wasm.csproj | Moves trimming template Wasm head to net10.0. |
| src/SolutionTemplate/MyAppXamlTrim/MyAppXamlTrim.Skia.WPF/MyAppXamlTrim.Skia.WPF.csproj | Moves trimming template WPF head to net10.0-windows. |
| src/SolutionTemplate/MyAppXamlTrim/MyAppXamlTrim.Skia.Linux.FrameBuffer/MyAppXamlTrim.Skia.Linux.FrameBuffer.csproj | Moves trimming template FrameBuffer head to net10.0. |
| src/SolutionTemplate/MyAppXamlTrim/MyAppXamlTrim.Mobile/MyAppXamlTrim.Mobile.csproj | Moves trimming template mobile TFMs to net10.0. |
| src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UnitTest/UnitTestsControl.cs | Adds trimming annotations/suppressions for reflection-based MSTest discovery. |
| src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UnitTest/UnitTestClassInfo.cs | Adds trimming annotations on stored test class Type. |
| src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Converters/FromNullableToDefaultValueConverter.cs | Adds trimming annotations/suppressions for default-value creation. |
| src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserContent.cs | Annotates sample chooser types for trimming. |
| src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleAttribute.cs | Annotates ViewModelType for trimming-safe reflection. |
| src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewModel.cs | Adds trimming suppression; removes a helper method. |
| src/SamplesApp/SamplesApp.Shared/App.xaml.cs | Adds trimming suppressions around reflection-based CLI feature parsing. |
| src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml/UIElementTests/TransformToVisual_Transform.xaml.cs | Refactors test runner creation to be trimming-friendly. |
| src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml/UIElementTests/TransformToVisual_ScrollViewer.xaml.cs | Switches to trimming-friendly TestRunner factory. |
| src/SamplesApp/SamplesApp.Samples/Windows_UI_Xaml_Controls/ImageTests/ImageSourceWriteableBitmapInvalidate.xaml.cs | Avoids GetType() in reflection path by using typeof(Buffer). |
| src/SamplesApp/SamplesApp.Samples/Windows_UI_Input/GestureRecognizerTests/PointersEvents.xaml.cs | Wraps reflective Handled setter with trimming suppression. |
| src/SamplesApp/SamplesApp.Samples/Utilities/ControlStateViewer.xaml.cs | Adds trimming annotations and AssertSetControlType<T>. |
| src/SamplesApp/SamplesApp.Samples/Microsoft_UI_Xaml_Controls/TestAppUtils/FrameExtensions.cs | Uses assembly-qualified IsTypePresent string. |
| src/SamplesApp/SamplesApp.Samples/Microsoft_UI_Xaml_Controls/SplitButtonTests/SplitButtonTestsPage.xaml.cs | Uses AssertSetControlType<T> for trimming-safe metadata. |
| src/SamplesApp/SamplesApp.Samples/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewAnimationPage.xaml.cs | Adds trimming suppression for Type.GetType lookup (and introduces an unused using). |
| src/SamplesApp/SamplesApp.Samples/Helpers/ViewModelBase.cs | Suppresses trimming warnings for reflective property access. |
| src/SamplesApp/SamplesApp.netcoremobile/SamplesApp.netcoremobile.csproj | Adds ILLink warning suppressions for SamplesApp netcoremobile build. |
| src/SamplesApp/SamplesApp.netcoremobile/iOS/Main.iOS.cs | Comments out Calabash start invocation for release iOS build path. |
| build/test-scripts/skia-ios-uitest-build.sh | Updates Skia iOS build TFM to net10.0-ios26.0. |
| build/test-scripts/run-netcore-mobile-template-tests.ps1 | Updates template test matrix to net10.0 (but currently references missing fixture paths). |
| build/test-scripts/ios-uitest-build.sh | Updates iOS UI test build TFM to net10.0-ios. |
| build/ci/tests/.azure-devops-tests-unit-tests.yml | Installs .NET 10 SDK for “netprevious” unit test support. |
| build/ci/tests/.azure-devops-tests-templates.yml | Installs .NET 10 SDK for template tests. |
| build/ci/tests/.azure-devops-tests-skia-build.yml | Updates WPF islands build/publish paths to net10.0-windows. |
| build/ci/tests/.azure-devops-tests-ios-skia-build.yml | Updates iOS Skia artifact path to net10.0-ios26.0 output folder. |
| build/ci/tests/.azure-devops-tests-ios-native.yml | Updates iOS native artifact path to net10.0-ios output folder. |
| build/ci/tests/.azure-devops-tests-android-native.yml | Updates Android native publish/artifact paths to net10.0-android. |
| build/ci/publish/.azure-devops-publish-ios-testflight.yml | Updates TestFlight publish TFMs/parameters to net10.0-ios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 214734 found UI Test snapshots differences: Details
|
5b072a0 to
8e04db8
Compare
8e04db8 to
d36b2eb
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
d36b2eb to
6d7b358
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 214879 found UI Test snapshots differences: Details
|
6d7b358 to
45a838a
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 214918 found UI Test snapshots differences: Details
|
45a838a to
55e8501
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 214961 found UI Test snapshots differences: Details
|
New .NET means new trimmer warnings!
…ry-tests-with-net10
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
Context: dd5b4ff Looks like commit dd5b4ff broke the **Tests - Android Native** stage: …/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_XYFocusTreeWalker.cs(23,14): error CS0260: Missing partial modifier on declaration of type 'Given_XYFocusTreeWalker'; another partial declaration of this type exists …/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_XYFocusTreeWalker.cs(198,23): error CS0260: Missing partial modifier on declaration of type 'FocusableXYFocusCUIElement'; another partial declaration of this type exists …/src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_XYFocusTreeWalker.cs(208,23): error CS0260: Missing partial modifier on declaration of type 'XYFocusCUIElement'; another partial declaration of this type exists Add the missing `partial` keyword so that this compiles.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
1 similar comment
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
In `uno56droidioswasmskia.csproj`, `$(TargetFrameworks)` *never* referenced a `net*-windows` target framework, so the `_UnoValidateSelfAssets` target appears to be dead code. Remove it. As `AddInWithCrossMajorVersionRefs.csproj` now targets net10.0, we don't need to worry about .NET 9-related codepaths. Remove them. Revert `targetframework-override-netprevious.props` to use "netprevious" target frameworks.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 217795 found UI Test snapshots differences: Details
|
|
|
Context: 7cd9cd6 The `Given_FrameworkElement_And_Leak.When_Add_Remove()` test fails under **Tests - WebAssembly Native** with: System.InvalidOperationException: Could not find type SamplesApp.Windows_UI_Xaml.Clipping.XamlButtonWithClipping_Scrollable, SamplesApp As with 7cd9cd6, the types that we lookup via `Type.GetType()` are in a different assembly under `__WASM__`. Update `SamplesAppAssembly` accordingly.
…ry-tests-with-net10
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 217894 found UI Test snapshots differences: Details
|
…ionFrameworkRefs Fixes: #23441 Got a little carried away with bumping everything to net10.0…
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 217986 found UI Test snapshots differences: Details
|
…ry-tests-with-net10
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23332/wasm-skia-net9/index.html |
|
The build 218033 found UI Test snapshots differences: Details
|
Context: #22745
Context: #22742
Context: #21171
Context: #21183
It's a new year, which means it's time to build and test against a new .NET version (.NET 11). However, as with previous years, this also means that existing tests/etc. are now running against a newer .NET version as well (.NET 10).
Similar to last year (#21171, #21183), update the tests and CI pipelines to build and test against .NET 10.
Let's see what breaks, to see which failures are due to .NET 10 vs. which are due to .NET 11.
PR Type:
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.