Repository navigation
Conversation
There was a problem hiding this comment.
⚠️ Not ready to approve
There are critical functional regressions/omissions in updated code paths (notably Android Custom Tabs null handling and net11 runtime asset probing) that should be addressed before merge.
Pull request overview
This PR updates the Uno repo’s build, packaging, CI, and a handful of platform-specific code paths to validate/build against .NET 11 Preview 5, moving the repo’s “current” TFM from net10.0 → net11.0 (and “previous” from net9.0 → net10.0), plus associated Apple/Android tooling/version bumps.
Changes:
- Promote
NetCurrenttonet11.0(and adjust templates, build scripts, CI pipelines, DevServer/RemoteControl packaging paths, and test infrastructure accordingly). - Centralize/realign build-time package versions (MSBuild + Roslyn), update Android/iOS/tvOS/maccatalyst minimums and related manifests/Info.plist values, and address nullability/API changes (notably on Apple + AndroidX).
- Add/adjust trimming-related suppressions and update some runtime/test logic to reduce new ILLink warnings.
PR description note: the PR template footer contains **GitHub Issue:** closes # but no issue number/link; please update to a proper fully-qualified issue link (e.g. Fixes https://github.com/unoplatform/uno/issues/22745).
File summaries
| File | Description |
|---|---|
| tools/ResourcesExtractor/ResourcesExtractor/ResourcesExtractor.csproj | Bump TFM to net10 Windows. |
| src/Uno.WinAppSDKSyncGenerator/Generator.cs | Update loaded TFMs from net9→net10. |
| src/Uno.UWP/Uno.netcoremobile.csproj | Split Android PackageReferences by net10 vs net11, add DocumentFile for net11. |
| src/Uno.UWP/Storage/StorageFolder.saf.Android.cs | DocumentFile nullability adjustments + SAF enumeration changes. |
| src/Uno.UWP/Storage/StorageFile.saf.Android.cs | DocumentFile nullability adjustments in SAF file wrapper. |
| src/Uno.UWP/Security/Authentication/Web/WebAuthenticationBrokerProvider.iOS.cs | InfoDictionary nullability guard. |
| src/Uno.UWP/Security/Authentication/Web/WebAuthenticationBrokerProvider.Android.cs | CustomTabs nullability/obsoletion handling updates. |
| src/Uno.UWP/Devices/Lights/Lamp.Android.cs | IDE0055 suppression around preprocessor layout. |
| src/Uno.UI/UI/Xaml/Media/Imaging/SvgImageSource.Apple.cs | Safer file extension handling + explicit “resource not found” failure. |
| src/Uno.UI/UI/Xaml/Media/Imaging/RenderTargetBitmap.UIKit.cs | Add explicit null checks for UIKit context/image APIs. |
| src/Uno.UI/UI/Xaml/Extensions/FontHelper.UIKit.cs | Handle updated UIKit nullability and safer font creation. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/iOSmacOS/UnoWKWebView.iOS.cs | Apple nullability fixes + path handling tweak + ResourcePath null check. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/iOSmacOS/NativeCoreWebView2HttpRequestHeaders.iOS.cs | Handle ToString() nullability annotation changes. |
| src/Uno.UI/UI/Xaml/Controls/ListViewBase/VirtualizingPanelLayout.UIKit.cs | NSIndexPath nullability suppression update. |
| src/Uno.UI.UnitTests/Uno.UI.UnitTests.csproj | Remove net9-only PackageReference workarounds. |
| src/Uno.UI.Tests.ViewLibraryProps/Uno.UI.Tests.ViewLibraryProps.csproj | Remove net9-only PackageReference workaround. |
| src/Uno.UI.Tests.ViewLibrary/Uno.UI.Tests.ViewLibrary.csproj | Remove net9-only PackageReference workaround. |
| src/Uno.UI.TestComparer/Uno.UI.TestComparer.csproj | Remove obsolete PackageReference workaround. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Markup/Given_XamlReader.cs | Add trimming suppressions around Activator usage. |
| src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFolder_Native.Android.cs | Guard against DocumentFile.FromFile returning null. |
| src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_StorageFile_Native.Android.cs | Add System import + guard DocumentFile.FromFile null. |
| src/Uno.UI.RuntimeTests/Tests/Windows_Storage/Given_FileIO_Native.Android.cs | Add System import + guard DocumentFile.FromFile null. |
| src/Uno.UI.RuntimeTests/Tests/HotReload/Frame/HRUnoLib/Uno.UI.RuntimeTests.HRUnoLib.csproj | Bump TFM to net11. |
| src/Uno.UI.RuntimeTests/Tests/HotReload/Frame/HRApp/Uno.UI.RuntimeTests.HRApp.Skia.csproj | Bump TFM to net11. |
| src/Uno.UI.RuntimeTests/Tests/AssemblyLoadContext/Given_AlcContentHost.cs | Add NET11_0 TFM selection. |
| src/Uno.UI.RuntimeTests/MUX/Utilities/MUXTestPage.cs | Add CodeAnalysis namespace import (likely for trimming attributes). |
| src/Uno.UI.Runtime.Skia.Android/Accessibility/UnoExploreByTouchHelper.cs | NET11 signature change + null node guard + labeled-by API swap. |
| src/Uno.UI.RemoteControl/buildTransitive/Uno.WinUI.DevServer.targets | DevServer host path defaults net9→net10 and net11 override. |
| src/Uno.UI.RemoteControl.ServerCore/Uno.UI.RemoteControl.ServerCore.csproj | Remove redundant Abstractions package refs (NU1510 cleanup). |
| src/Uno.UI.RemoteControl.Server/Uno.UI.RemoteControl.Server.csproj | Remove redundant DI abstractions reference. |
| src/Uno.UI.RemoteControl.Server.Processors/Uno.UI.RemoteControl.Server.Processors.csproj | Centralize MSBuild/Roslyn refs + crypto xml bump + add logging ref. |
| src/Uno.UI.RemoteControl.Host/Uno.UI.RemoteControl.Host.csproj | Update which global.json is copied per TFM. |
| src/Uno.UI.RemoteControl.DevServer.Tests/Telemetry/TelemetryProcessorTests.cs | Update test paths/comments for net11. |
| src/Uno.UI.RemoteControl.DevServer.Tests/Mcp/Given_DiscoveryIssueMapper.cs | Update expected DotNetTfm/HostPath strings to net11. |
| src/Uno.UI.RemoteControl.DevServer.Tests/Helpers/ExternalDllDiscoveryHelper.cs | Probe net11 instead of net10 by default + update docs. |
| src/Uno.UI.RemoteControl.DevServer.Tests/AppLaunch/RealAppLaunchIntegrationTests.cs | Update comments about detected framework. |
| src/Uno.UI.FluentTheme.v2/themeresources_v2.xaml | Clarify disabled-state dimming behavior comment. |
| src/Uno.UI.Dispatching/Uno.UI.Dispatching.netcoremobile.csproj | Comment update for UnoTargetFrameworkOverride example. |
| src/Uno.UI.DevServer.Cli/Uno.UI.DevServer.Cli.csproj | Bump TFM net9→net10. |
| src/Uno.UI.DevServer.Cli/Helpers/DiscoveryInfo.cs | Update doc comment example TFM. |
| src/Uno.UI.DevServer.Cli.E2E.Tests/Uno.UI.DevServer.Cli.E2E.Tests.csproj | Bump tests to net11. |
| src/Uno.UI.DevServer.Cli.E2E.Tests/Mcp/TemporaryUnoWorkspaceBuilder.cs | Update host discovery path/net11 error text. |
| src/Uno.UI.DevServer.Cli.E2E.Tests/Mcp/BuildOutputLocator.cs | Probe net10+net11 outputs, drop net9. |
| src/Uno.UI.BindingHelper.Android/Uno.UI.BindingHelper.Android.netcoremobile.csproj | Update docs-generation TFM comments net9→net10. |
| src/Uno.UI.Adapter.Microsoft.Extensions.Logging/MicrosoftLogger.cs | Ensure non-null formatter message for logging adapter. |
| src/Uno.Sdk/Uno.Sdk.csproj | Remove obsolete transitive vulnerability pin PackageReference. |
| src/Uno.Sdk/targets/Uno.DefaultItems.Resizetizer.targets | Comment update (net9→net10). |
| src/Uno.Sdk/targets/Uno.Common.Wasm.targets | Comment update (net10→net11). |
| src/Uno.Sdk/Sdk/Sdk.props.buildschema.json | Update schema description for net10 instead of net9. |
| src/Uno.Sdk/packages.json | Move versionOverride keys net10→net11 for various packages. |
| src/Uno.ReferenceImplComparer/Program.cs | Update reference TFMs net9+net10 → net10+net11. |
| src/Uno.HotReload/Uno.HotReload.csproj | Centralize MSBuild/Roslyn refs + crypto xml bump. |
| src/Uno.Foundation.Runtime.WebAssembly/Interop/WebAssembly.Runtime.cs | Update net11 error message text. |
| src/Uno.CrossTargetting.targets | Android SupportedOSPlatformVersion bump 21→24. |
| src/Uno.Analyzers.Tests/Uno.Analyzers.Tests.csproj | Remove net9-only workaround packages. |
| src/targetframework-override.props | Add net11 Apple TFMs; remove net9 Apple mappings. |
| src/targetframework-override-windows.props | Shift net10→net11 and net9→net10 mapping. |
| src/targetframework-override-noplatform.props | Use NetPrevious/NetCurrent for no-platform override. |
| src/targetframework-override-netprevious.props | Update Apple TFM mappings for net10 “previous”. |
| src/SourceGenerators/Uno.UI.Tasks/Uno.UI.Tasks.csproj | Centralize MSBuild package versions (drop explicit versions). |
| src/SourceGenerators/Uno.UI.Tasks/RuntimeAssetsSelector/RuntimeAssetsSelectorTask.cs | Runtime asset selection updates (needs net11 probing fix). |
| src/SourceGenerators/Uno.UI.Tasks/LinkerHintsGenerator/LinkerHintGeneratorTask.cs | Adjust runtime TFM mapping threshold for linker hint rewrite. |
| src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets | Update comments about linker task path layouts. |
| src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/AndroidResourcesGenerator.cs | Comment update for net10+ resource constants. |
| src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props | Use NetCurrent/NetPrevious for net-std ref detection. |
| src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeBehindGeneratorTests/XamlCodeBehindGeneratorTests.cs | Update path examples to net11. |
| src/SourceGenerators/Uno.UI.SourceGenerators.Tests/UnoAssemblyHelper.cs | Update previous/current TFM constants net10→net11. |
| src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdateTests/Given_HotReloadService.cs | Update comment path example to net11. |
| src/SourceGenerators/Uno.UI.SourceGenerators.Tests/MetadataUpdates/HotReloadWorkspaceProvider.cs | Add NET11 caps constants. |
| src/SourceGenerators/Uno.UI.SourceGenerators.Tests/_Dotnet.cs | Switch previous/current monikers to net10/net11 (ref asm TODOs remain). |
| src/SourceGenerators/System.Xaml/Uno.Xaml.csproj | Suppress ILLink warnings for generators. |
| src/SourceGenerators/System.Xaml/System.Xaml.Schema/XamlValueConverter.cs | Add trimming suppression attribute. |
| src/SourceGenerators/System.Xaml/System.Windows.Markup/ValueSerializer.cs | Add trimming suppression attribute + import. |
| src/SourceGenerators/sourcegenerators.local.props | Update RC host path logic net9→net10 + net11 override. |
| src/SolutionTemplate/5.6/uno56netcurrent/uno56netcurrent/uno56netcurrent.csproj | Template TFMs bump to net11 and update RC reference guard. |
| src/SolutionTemplate/5.6/uno56netcurrent/uno56netcurrent/Properties/launchSettings.json | Update launch args path net9→net10 desktop. |
| src/SolutionTemplate/5.6/uno56net9win32/uno56net9win32/Properties/launchSettings.json | Update launch args path net9→net10 desktop. |
| src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/Properties/launchSettings.json | Update launch args path net9→net10 desktop. |
| src/SolutionTemplate/5.3/uno53AppWithLib/uno53AppWithLib/Properties/launchSettings.json | Update launch args path net9→net10 desktop. |
| src/SamplesApp/UnoIslandsSamplesApp.Skia/UnoIslandsSamplesApp.Skia.csproj | Remove net9-only workaround packages. |
| src/SamplesApp/SamplesApp.Skia.netcoremobile/tvOS/Info.plist | MinimumOSVersion bump to 13.0. |
| src/SamplesApp/SamplesApp.Skia.netcoremobile/SamplesApp.Skia.netcoremobile.csproj | Add net11 Android deps, r8 workaround, Apple min version bump, cleanup Android SupportedOSPlatformVersion noise. |
| src/SamplesApp/SamplesApp.Skia.netcoremobile/iOS/Info.plist | MinimumOSVersion bump to 13.0. |
| src/SamplesApp/SamplesApp.Skia.netcoremobile/Android/AndroidManifest.xml | minSdkVersion bump 21→24. |
| src/SamplesApp/SamplesApp.Samples/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewAnimationPage.xaml.cs | Add missing using (System.Globalization). |
| src/SamplesApp/SamplesApp.netcoremobile/SamplesApp.netcoremobile.csproj | Add net11 Android deps, r8 workaround, cleanup Android SupportedOSPlatformVersion noise. |
| src/SamplesApp/SamplesApp.netcoremobile/Android/AndroidManifest.xml | minSdkVersion bump 21→24. |
| src/Directory.Build.targets | Centralize MSBuild/Roslyn package versions by TFM. |
| src/AddIns/Uno.UI.Maps/Uno.UI.Maps.netcoremobile.csproj | Use Apple OS version properties; add net11 Android package versions. |
| src/AddIns/Uno.UI.GooglePlay/Uno.UI.GooglePlay.netcoremobile.csproj | Add net11 Android package versions. |
| src/AddIns/Uno.UI.Foldable/Uno.UI.Foldable.netcoremobile.csproj | Add net11 Android package versions. |
| Directory.Build.props | NetPrevious/NetCurrent bump and introduce Apple OS version properties. |
| build/Uno.UI.Build.csproj | Target net current (property-based) instead of hardcoding. |
| build/test-scripts/skia-ios-uitest-build.sh | Update iOS build to net11. |
| build/test-scripts/run-netcore-mobile-template-tests.ps1 | Update template test TFMs to net11 (incl. Windows tfm strings). |
| build/test-scripts/run-net7-template-linux.ps1 | Update net-current TFMs in Linux script. |
| build/test-scripts/run-devserver-cli-tests.ps1 | Validate devserver package contains net10 + net11 host binaries. |
| build/test-scripts/run-devserver-cli-local.ps1 | Update local cache probing for net11 host. |
| build/test-scripts/local-android-uitest-run.sh | Update sample publish/copy paths to net10. |
| build/test-scripts/ios-uitest-run.sh | Update iOS UnoTargetFrameworkOverride net9→net10 Apple TFM. |
| build/nuget/Uno.WinUI.XamlHost.nuspec | Add net11 assets and drop net9 assets for XamlHost packaging. |
| build/nuget/uno.winui.winappsdk.targets | Update reference paths net9→net10 for toolkit assets. |
| build/nuget/Uno.WinUI.Svg.nuspec | Add net11 assets and update dependency TFMs; adjust SkiaSharp views dependency. |
| build/nuget/Uno.WinUI.MSAL.nuspec | Add net11 assets and update dependency TFMs. |
| build/nuget/Uno.WinUI.Lottie.nuspec | Add net11 assets and update dependency TFMs. |
| build/nuget/Uno.WinUI.Graphics2DSK.nuspec | Add net11 assets and update dependency TFMs. |
| build/nuget/Uno.WinUI.DevServer.nuspec | Add net11 assets/host/processors and update dependency TFMs. |
| build/nuget/Uno.WinRT.nuspec | Add net11 assets and drop net9 assets; update Android TFM group. |
| build/nuget/Uno.Foundation.nuspec | Add net11 assets and drop net9 assets; update Android TFM group. |
| build/gitpod/build-wasm.sh | Update override TFM net9→net10. |
| build/gitpod/build-skia.sh | Update override TFM net9→net10. |
| build/ci/tests/.azure-devops-tests-webassembly-skia-build.yml | Switch UnoCheck/publish to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-webassembly-native.yml | Switch UnoCheck/publish/artifacts to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-skia-build.yml | Switch UnoCheck/artifacts to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-ios-skia-build.yml | Switch UnoCheck to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-ios-native.yml | Switch UnoCheck to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-android-skia-build.yml | Switch UnoCheck/publish/artifacts to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-android-nativeaot-skia-build.yml | Switch UnoCheck/publish/artifacts to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-android-native.yml | Switch UnoCheck to net11 + preview-major. |
| build/ci/tests/.azure-devops-tests-android-coreclr-skia-build.yml | Switch UnoCheck/publish/artifacts to net11 + preview-major. |
| build/ci/templates/dotnet-install.yml | Parameterize global.json selection (net11 default). |
| build/ci/net11/_global.json | Add net11 preview global.json. |
| build/ci/build/.azure-devops-build-managed.yml | Switch UnoCheck TFMs to net11 + preview-major. |
| .vsts-ci.yml | Update macOS runner/Xcode + DotNetSdkVersion net11 preview, add net current/previous variables. |
| .globalconfig | Update comment referencing net9→net10. |
| .github/workflows/codeql.yml | Update build to net11. |
| .devcontainer/Dockerfile | Update uno-check TFMs to net11. |
Copilot's findings
- Files reviewed: 128/128 changed files
- Comments generated: 3
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public override async Task<IReadOnlyList<StorageFolder>> GetFoldersAsync(CancellationToken ct) | ||
| { | ||
| return await Task.Run(() => | ||
| { | ||
| var contents = _directoryDocument | ||
| .ListFiles() | ||
| var contents = (_directoryDocument |
| var parentActivity = CurrentActivity; | ||
|
|
||
| var customTabsActivityManager = CustomTabsActivityManager.From(parentActivity); | ||
| #pragma warning disable CS0618 | ||
| // obsolete API; don't want to migrate now. | ||
| var customTabsActivityManager = CustomTabsActivityManager.From(parentActivity!)!; |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
|
|
Context: unoplatform/uno#23479 When trying to build unoplatform/uno#23479, the **Build - Managed Binaries > Build > Building Managed Binaries** job failed with: C:\a\1\s\src\Uno.UI.BindingHelper.Android\Uno.UI.BindingHelper.Android.netcoremobile.csproj(107,3): error : The Android SDK for API level 37 is not installed. Install it through the Android SDK manager. [TargetFramework=net11.0-android] Looking through the provisioning code, the only thing used at the time to provision Android dependencies was uno-check within `dotnet-mobile-install-windows.yml`, which *effectively* ran (after parameter substitutions): - powershell: | & dotnet tool update --global uno.check --version $(GlobalUnoCheckVersion) --add-source https://api.nuget.org/v3/index.json & uno-check … --preview-major net11.0-android displayName: Install .NET Workloads which produced log output of: – platforms;android-36 (2) – system-images;android-35;google_apis;x86_64 (7) skipped because the android emulator is skipped. – platform-tools (37.0.0) – cmdline-tools;17.0 (17.0) .NET 11 P5 needs API-37.0; uno-check only provisions API-36. Update `uno.ui-preview-major.manifest.json` so that the installed Android package versions match those within .NET 11 P5's `Xamarin.Android.Common.props`, which currently states: <AndroidSdkBuildToolsVersion Condition=" '$(AndroidSdkBuildToolsVersion)' == '' ">36.0.0</AndroidSdkBuildToolsVersion> <AndroidSdkPlatformToolsVersion Condition="'$(AndroidSdkPlatformToolsVersion)' == ''">36.0.0</AndroidSdkPlatformToolsVersion> <AndroidSdkPlatformVersion Condition=" '$(AndroidSdkPlatformVersion)' == '' ">android-37.0</AndroidSdkPlatformVersion> <AndroidCommandLineToolsVersion Condition=" '$(AndroidCommandLineToolsVersion)' == '' ">19.0</AndroidCommandLineToolsVersion>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
fef6ed6 to
6593537
Compare
There was a problem hiding this comment.
⚠️ Not ready to approve
Critical net11 enablement paths are currently broken by incorrect runtime asset probing/mapping logic (and a likely remaining NU1703-triggering AndroidX.Browser reference on net10-android).
Copilot's findings
Comments suppressed due to low confidence (1)
src/SourceGenerators/Uno.UI.Tasks/RuntimeAssetsSelector/RuntimeAssetsSelectorTask.cs:33
LatestSupportedDotnetVersionis used to probeuno-runtime/netX.0/...folders. WithNetCurrentnow at net11.0, leaving this at 10 prevents the task from finding net11 runtime assets and will fall back to older TFMs (or fail).
- Files reviewed: 129/129 changed files
- Comments generated: 3
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
| #if NET9_0_OR_GREATER | ||
| public static void InvokeOnMainThread() | ||
| { | ||
| throw new NotSupportedException($"Uno Platform on net10.0 does not support threading yet."); | ||
| throw new NotSupportedException($"Uno Platform on net11.0 does not support threading yet."); | ||
| } |
| var runtimeTargetFramework = | ||
| new Version(TargetFrameworkVersion) >= new Version("9.0") | ||
| ? "net9.0" | ||
| new Version(TargetFrameworkVersion) >= new Version("10.0") | ||
| ? "net10.0" | ||
| : "netstandard2.0"; |
| <ItemGroup Condition=" '$(TargetFramework)' == 'net10.0-android' "> | ||
| <PackageReference Include="Xamarin.AndroidX.AppCompat" /> | ||
| <PackageReference Include="Xamarin.AndroidX.Browser" Version="1.0.0" /> | ||
| </ItemGroup> |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/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-23479/wasm-skia-net9/index.html |
|
|
e6992f6 to
65a7723
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
|
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
|
|
Context: #22745 Context: unoplatform/uno.templates#1992 Context? 69cc392 It's that time of year again! .NET 11 previews are out; does Uno work with .NET 11? Let's find out! Build system changes and notes: * Centralize NuGet package versions for the Microsoft.Build* and Microsoft.CodeAnalysis* NuGet packages. * Leave `FontFallbackPreprocessor.csproj` targeting net10.0, as this job never provisions .NET itself, and .NET 10 is pre-installed on that CI bot. * Update `$(macOSVMImage)` to use `macOS-26` (up from `macOS-15`). dotnet/macios in .NET 11 now requires Xcode 26.5, and only the [macOS-26 runner-image][0] provides Xcode 26.5.x. * When it makes sense to do so, use `$(NetPrevious)` and `$(NetCurrent)` instead of hardcoding target frameworks. When it *doesn't* make sense to do so: specifying NuGet package versions, which are normally only bumped when the .NET version changes, and it makes things clearer that these are related by using explicit .NET versions and *not* using `$(Net*)`. * Introduce new `$(NetPreviousAppleOSVersion)` and `$(NetCurrentAppleOSVersion)` MSBuild properties to avoid hardcoding Apple OS versions. * net11.0-ios and net11.0-tvos bump the minimum supported `$(SupportedOSPlatformVersion)` value to 13.0. * Bump `Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing` NuGet package version to 1.1.3, so that we can use e.g. `ReferenceAssemblies.Net.Net100`. * Bump `System.Security.Cryptography.Xml` NuGet package version to 10.0.0, as newer `Microsoft.CodeAnalysis` NuGet packages require that System.Security.Cryptography.Xml be >= 9.0. * Bump NuGet Package versions for .NET 11 Android; resolves: Missing class javax.lang.model.element.Modifier (referenced from: javax.lang.model.element.Modifier[] com.google.errorprone.annotations.IncompatibleModifiers.value() and 1 other context) * However, updating those package versions means we need to bump `$(SupportedOSPlatformVersion)` to 24 (up from 21). Update that in `Uno.CrossTargetting.targets`, and *remove* `$(SupportedOSPlatformVersion)` from `SamplesApp*.netcoremobile.csproj` as those are "confusing noise"; they're not used, as `Uno.CrossTargetting.targets` always replaces. Also update `//uses-sdk/@android:minSdkVersion` in various `AndroidManifest.xml` to be at least 24. * Some of the updated .NET 11 Android NuGet packages also broke API in various ways; update `UnoExploreByTouchHelper.cs`/etc. to compensate. * Update `src/Uno.UWP/Uno.netcoremobile.csproj` to add an explicit `@(PackageReference)` to Xamarin.AndroidX.DocumentFile. This was previously implicitly brought in by [email protected], but we can't use that version anymore due to NU1703 warnings: error NU1703: Package 'Xamarin.AndroidX.Browser' 1.0.0 uses the deprecated MonoAndroid framework instead of 'net6.0-android' or later. Consider upgrading to a newer version of this package or contacting the package author. The updated Xamarin.AndroidX.DocumentFile in turn has changes to nullability and obsoletions, requiring changes. * Fix NU1510 errors by removing `@(PackageReference)`s for the mentioned packages: Microsoft.Extensions.Logging.Abstractions, Microsoft.CSharp, System.Formats.Asn1, System.Net.Http, System.Text.RegularExpressions. * Set `$(AndroidLinkTool)`=r8 in SamplesApp projects for net11.0-android. This works around a crash in r8. TODO: upstream URL. * Reminder: `.azure-devops-tests-ios-skia-build.yml` must be consistent with `skia-ios-uitest-build.sh`. Source code changes: * Apple platforms such as net11.0-ios26.5 have changed nullability of methods such as `NSObject.FromObject()`. Compensate. While updating nullability, also update nearby logic errors. `UnoWKWebView.ProcessNavigation()` calls `relativePath.Substring(1)` if `relativePath` starts with a `/`, but if it were to start with *multiple* slashes, the result would still start with a slash. Use `resultPath.TrimStart('/')` instead. `SvgImageSource.OpenSvgBundle()` could have `fileExtension==""` and would then call `fileExtension.Substring(1)`, which could throw. Use `fileExtension.TrimStart('.')` instead. * `object.ToString()` has long returned nullable `string?`, but only now is it apparently impacting `NativeCoreWebView2HttpRequestHeaders.iOS.cs`. (Go figure.) * .NET 11 has new IDE0055 warnings for pre-existing constructs; in particular, `else if` must be on the same line, and `#region`/`#endregion` must have matching indentation. Update various files to fix these warnings. * The updated Xamarin.AndroidX.DocumentFile NuGet package has nullability changes. Adapt. * Trimmer fixes! TODO description. * Update `Given_BrowserKeyboardInputSource.cs` to use `Type.GetType(string)` instead of `AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(…).GetType(…)` to fix IL2026 and IL2072 warnings: Given_BrowserKeyboardInputSource.cs(43,5): error IL2026: Using member 'System.Reflection.Assembly.GetType(String)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed by trimming. If the type name is a string literal, consider using Type.GetType instead. Given_BrowserKeyboardInputSource.cs(50,18): error IL2072: 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.NonPublicConstructors' in call to 'System.Runtime.CompilerServices.RuntimeHelpers.GetUninitializedObject(Type)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. Given_BrowserKeyboardInputSource.cs(53,22): error IL2075: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetEvent(String, BindingFlags)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. Given_BrowserKeyboardInputSource.cs(58,18): error IL2075: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.NonPublicMethods' in call to 'System.Type.GetMethod(String, BindingFlags)'. The return value of method 'System.Reflection.Assembly.GetType(String)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. * Update `SamplesApp.netcoreapp.csproj` to ignore IL2026 warnings from `System.Data`: error IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataSet.WriteXmlSchema(DataSet, XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.GetSchema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimmed if not referenced directly. error IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataSet.ReadXmlSerializableInternal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. error IL2026: System.Data.DataSet.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataSet.WriteXmlInternal(XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.WriteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. error IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataTable.GetXmlSchema()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.GetSchema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimmed if not referenced directly. error IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataTable.ReadXmlSerializableInternal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. error IL2026: System.Data.DataTable.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataTable.WriteXmlInternal(XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.WriteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if not referenced directly. error IL2026: System.ComponentModel.DefaultValueAttribute.DefaultValueAttribute(Type, String): Using member 'System.ComponentModel.DefaultValueAttribute.<.ctor>g__TryConvertFromInvariantString|4_0(Type, String, Object&)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DefaultValueAttribute usage of TypeConverter is not compatible with trimming. Commands to migrate from net9+net10 to net10+net11, for posterity: git grep -l 'net10\.0' | while read file ; do sed -i '' 's/net10\.0/net11\.0/g' $file ; done git grep -l 'net9\.0' | while read file ; do sed -i '' 's/net9\.0/net10\.0/g' $file ; done git grep -l net10.0-ios18.0 | while read file ; do sed -i '' 's/net10.0-ios18.0/net10.0-ios26.0/g' $file ; done git grep -l net10.0-tvos18.0 | while read file ; do sed -i '' 's/net10.0-tvos18.0/net10.0-tvos26.0/g' $file ; done git grep -l net10.0-maccatalyst18.0 | while read file ; do sed -i '' 's/net10.0-maccatalyst18.0/net10.0-maccatalyst26.0/g' $file ; done git grep -l net11.0-ios26.0 | while read file ; do sed -i '' 's/net11.0-ios26.0/net11.0-ios26.5/g' $file ; done git grep -l net11.0-tvos26.0 | while read file ; do sed -i '' 's/net11.0-tvos26.0/net11.0-tvos26.5/g' $file ; done git grep -l net11.0-maccatalyst26.0 | while read file ; do sed -i '' 's/net11.0-maccatalyst26.0/net11.0-maccatalyst26.5/g' $file ; done `@(PackageReference)` needs to be reviewed, as the above "in-place" updates mean that "net10.0" is using the same packages as "net9.0", which are almost certainly wrong. To easily find files to review: git status | grep modified: | cut -c 14- | while read file ; do if git diff HEAD^ $file | grep '<PackageReference' >/dev/null 2>&1 ; then echo $file fi done > review.txt To sanity-check locally, try: cp build/ci/net11/_global.json global.json export PATH=/location/of/net11:$PATH dotnet build -f net11.0 src/Uno.Foundation/Uno.Foundation.csproj dotnet build -f net11.0 src/Uno.UI/Uno.UI.Skia.csproj dotnet build -f net11.0-android src/Uno.UI/Uno.UI.netcoremobile.csproj dotnet build -f net11.0-android src/SamplesApp/SamplesApp.Skia.netcoremobile/SamplesApp.Skia.netcoremobile.csproj dotnet publish -f net11.0-android src/SamplesApp/SamplesApp.Skia.netcoremobile/SamplesApp.Skia.netcoremobile.csproj -p:RunAOTCompilation=false -p:UnoTargetFrameworkOverride=net11.0-android -p:UNO_DISABLE_ANALYZERS_IN_SAMPLES=true -bl dotnet build -f net10.0-ios -c Release -p:UnoTargetFrameworkOverride=net10.0-ios -bl src/SamplesApp/SamplesApp.netcoremobile/SamplesApp.netcoremobile.csproj TODO: * When unoplatform/uno.templates supports .NET 11 (unoplatform/uno.templates#1992), update `RealAppLaunchIntegrationTests.cs._targetFramework` to net11.0. [0]: https://github.com/actions/runner-images/blob/9e3319d6b4acc306925295853d0ff41ddd5c40f0/images/macos/macos-26-Readme.md#xcode
**Build - Managed Binaries > Build > Building Managed Binaries** failed with: C:\a\1\s\src\Uno.UI.BindingHelper.Android\Uno.UI.BindingHelper.Android.netcoremobile.csproj(107,3): error : The Android SDK for API level 37 is not installed. Install it through the Android SDK manager. [TargetFramework=net11.0-android] Bump GlobalUnoCheckVersion to 1.35.0-dev.28 so that uno-check provisions API-37.0, which should fix the above error. Additionally, `Uno.UI.BindingHelper.Android.netcoremobile.csproj` needed to be updated for current Android API levels: ever since Android 16 QPR2, Android API levels are a "major.minor" affair; it's not "API-37", it's "API-37.0". It's not "platforms\android-37\android.jar", it's "platforms\android-37.0\android.jar". Update the logic within `_CompileUnoJava` to use wildcards to locate `android.jar`. **Tests - iOS Skia > Build Samples App > Select Xcode** failed because the runner image had been updated since last time I looked to contain a "real" Xcode_26.5.app, not Xcode 26.5 Beta 2. Update `$(xCodeRoot)` accordingly. **Build - Skia Runtime Tests > Build Samples App > Publish Generic Binaries:** failed because we built for net10.0, but PublishPipelineArtifact was looking for net11.0 outputs. Try fixing this by using the new top-level `$(netCurrentTargetFramework)` and `$(netPreviousTargetFramework)` variables. Does it work? **Tests - Unit Tests > Run > Build unit tests solution filter** failed with: …\src\Uno.Analyzers.Tests\Uno.Analyzers.Tests.csproj : error NU1605: Warning As Error: Detected package downgrade: Microsoft.CodeAnalysis.Common from 4.14.0 to 4.0.0. Reference the package directly from the project to select a different version. …\src\Uno.Analyzers.Tests\Uno.Analyzers.Tests.csproj : error NU1605: Uno.Analyzers.Tests -> Microsoft.CodeAnalysis.CSharp.Workspaces 4.14.0 -> Microsoft.CodeAnalysis.Common (= 4.14.0) …\src\Uno.Analyzers.Tests\Uno.Analyzers.Tests.csproj : error NU1605: Uno.Analyzers.Tests -> Microsoft.CodeAnalysis.Common (>= 4.0.0) Update `Uno.Analyzers.Tests.csproj` to bump `$(CodeAnalysisVersionForAnalyzersTests)`=4.14.0 to fix the NU1605. Update `.azure-devops-tests-android-native.yml` and `.azure-devops-tests-templates.yml` to remove the installation of `platforms;android-35`. We're now using the [macOS-26 runner image][0], which has API-35, API-36, and API-37.0 already installed. [0]: https://github.com/actions/runner-images/blob/ef933bf3909a6c0f39801156845874c9e43ba768/images/macos/macos-26-Readme.md#android
Context: 6593537 Commit 6593537 noted: > **Build - Skia Runtime Tests > Build Samples App > Publish Generic Binaries:** > failed because we built for net10.0, but PublishPipelineArtifact was > looking for net11.0 outputs. Try fixing this by using the new > top-level `$(netCurrentTargetFramework)` and > `$(netPreviousTargetFramework)` variables. Does it work? It *does* work. Which means we can now *extend* this idea. *Everywhere*. Old-and-busted: duplicate target framework monikers across files (and/or *within* files): # ios-uitest-build.sh dotnet build -f net10.0-ios … # .azure-devops-tests-ios-native.yml - bash: | ios-uitest-build.sh - CopyFiles@2 inputs: SourceFolder: …/net10.0-ios/… If we update `ios-uitest-build.sh` we need to update `.azure-devops-tests-ios-native.yml` as well; often not obvious. New-hawtness: use `$(netCurrentTargetFramework)` *in the same scope*: # ios-uitest-build.sh dotnet build -f $TFM … # .azure-devops-tests-ios-native.yml - bash: | TFM=$(netCurrentTargetFramework)-ios ios-uitest-build.sh - CopyFiles@2 inputs: SourceFolder: …/$(netCurrentTargetFramework)/… This helps ensure that the separate build commands and `CopyFiles@2` steps are consistent with each other. Additionally, if (when) we need to update `$(netCurrentTargetFramework)` in the future (.NET 12!), we won't need to touch these files at all! Apply to all `.yml` files.
The **Tests - Unit Tests > Run > Run unit tests** job is failing,
and one of the reported errors is:
Test method Uno.UI.SourceGenerators.Tests.DependencyObjectGeneratorTests.Given_DependencyObjectGenerator.TestNested threw exception:
System.InvalidOperationException: Mismatch between number of diagnostics returned, expected "0" actual "3"
Diagnostics:
// error CS1705: Assembly 'Uno' with identity 'Uno, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
DiagnosticResult.CompilerError("CS1705").WithArguments("Uno", "Uno, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null", "System.Runtime, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Runtime", "System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"),
…
The cause of the problem is that `_Dotnet.Current` is returning
reference assemblies for *.NET 10*, not .NET 11, largely because the
[Microsoft.CodeAnalysis.Analyzer.Testing NuGet package][0] doesn't
contain an entry for .NET 11, and presumably won't until *after* the
release of .NET 11 in 2026-November.
What do we do instead?
"Fake it 'til you make it": the definition of
[`ReferenceAssemblies.Net100`][1] is concise and straightforward;
copy it, updating for .NET 11. Do the same for .NET 11 Android.
[0]: https://www.nuget.org/packages/Microsoft.CodeAnalysis.Analyzer.Testing
[1]: ttps://github.com/dotnet/roslyn-sdk/blob/cc62642b58a306b2560a2367f1a0c11167ea3b2b/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/ReferenceAssemblies.cs#L1216-L1231
**Tests - WebAssembly Skia > Run Runtime Tests *:** are failing under .NET 11: FocusMovesToNextCorrectElementWhenFocusCandidateElementCollapsed System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Runtime.CompilerServices.RuntimeFeature.ThrowIfMultithreadingIsNotSupported() at System.Threading.Tasks.Task.InternalWaitCore(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait(TimeSpan timeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait(TimeSpan timeout) at Microsoft.UI.Xaml.Tests.Common.EventTester`2[[Microsoft.UI.Xaml.UIElement, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null],[Microsoft.UI.Xaml.RoutedEventArgs, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null]]..ctor(UIElement sender, Type senderType, String eventName, Action`2 action, EventTesterOptions options, Boolean setBVTflags) at Microsoft.UI.Xaml.Tests.Common.EventTester`2[[Microsoft.UI.Xaml.UIElement, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null],[Microsoft.UI.Xaml.RoutedEventArgs, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null]]..ctor(UIElement sender, Type senderType, String eventName, Action`2 action, EventTesterOptions options) at Microsoft.UI.Xaml.Tests.Common.EventTester`2[[Microsoft.UI.Xaml.UIElement, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null],[Microsoft.UI.Xaml.RoutedEventArgs, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null]]..ctor(UIElement sender, String eventName, Action`2 action) at Microsoft.UI.Xaml.Tests.Common.EventTester`2[[Microsoft.UI.Xaml.UIElement, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null],[Microsoft.UI.Xaml.RoutedEventArgs, Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null]]..ctor(UIElement sender, String eventName) at Uno.UI.RuntimeTests.MUX.Input.Focus.FocusHelper.EnsureFocusAsync(UIElement element, FocusState focusState, UInt32 Attempts) at Uno.UI.RuntimeTests.MUX.Input.Focus.FocusTests.FocusMovesToNextCorrectElementWhenFocusCandidateElementCollapsed() at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_2.<<ExecuteTestsForInstance>g__InvokeTestMethod|5>d.MoveNext() This is due to a change within .NET 11, in which `Task.InternalWaitCore()` was updated to throw `PlatformNotSupportedException` in wasm environments: * dotnet/runtime@a118808 * dotnet/runtime@25eb60e The "offending" `Task.Wait()` invocation was *already* wrapped within `!__WASM__` blocks, but these don't apply within `SamplesApp.Skia.WebAssembly.Browser`, as that uses *Skia* build variants of e.g. Uno.UI.RuntimeTests, not Wasm build variants. Update `EventTester.cs` to add an additional runtime check before the `Task.Wait()` invocations when running within a browser: // old and busted #if !__WASM__ task.Wait(); #endif // new hawtness #if !__WASM__ if (!ConditionalTestHelper.CurrentPlatform.HasFlag(RuntimeTestPlatforms.SkiaWasm)) { task.Wait(); } #endif This allows the `Task.Wait()` invocation to be avoided within a browser environment, allowing the tests to pass.
**Tests - Unit Tests > Run > Run unit tests** is failing for
`Uno.UI.RemoteControl.DevServer.Tests.dll`:
failed WhenRealAppBuiltAndRunWithDevServer_RealConnectionEstablished (49s 436ms)
from C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\bin\Release\net11.0\Uno.UI.RemoteControl.DevServer.Tests.dll (net11.0|x64)
Test method Uno.UI.RemoteControl.DevServer.Tests.AppLaunch.RealAppLaunchIntegrationTests.WhenRealAppBuiltAndRunWithDevServer_RealConnectionEstablished threw exception:
AwesomeAssertions.Execution.AssertionFailedException: Expected filtered.Any(e => e.Json.RootElement.TryGetProperty("EventName", out var n) && n.GetString() == eventName) to be True because Should contain event 'uno/dev-server/app-launch/connected', but found False.
at AwesomeAssertions.Execution.FallbackTestFramework.Throw(String message)
at AwesomeAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
at AwesomeAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
at AwesomeAssertions.Primitives.BooleanAssertions`1.BeTrue(String because, Object[] becauseArgs)
at Uno.UI.RemoteControl.DevServer.Tests.Telemetry.TelemetryTestBase.AssertHasEvent(List`1 events, String eventName, String prefix) in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\Telemetry\TelemetryTestBase.cs:219
at Uno.UI.RemoteControl.DevServer.Tests.AppLaunch.RealAppLaunchIntegrationTests.WhenRealAppBuiltAndRunWithDevServer_RealConnectionEstablished() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\AppLaunch\RealAppLaunchIntegrationTests.cs:59
at Uno.UI.RemoteControl.DevServer.Tests.AppLaunch.RealAppLaunchIntegrationTests.WhenRealAppBuiltAndRunWithDevServer_RealConnectionEstablished() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\AppLaunch\RealAppLaunchIntegrationTests.cs:70
at Uno.UI.RemoteControl.DevServer.Tests.AppLaunch.RealAppLaunchIntegrationTests.WhenRealAppBuiltAndRunWithDevServer_RealConnectionEstablished() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\AppLaunch\RealAppLaunchIntegrationTests.cs:94
at Uno.UI.RemoteControl.DevServer.Tests.AppLaunch.RealAppLaunchIntegrationTests.WhenRealAppBuiltAndRunWithDevServer_RealConnectionEstablished() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\AppLaunch\RealAppLaunchIntegrationTests.cs:94
at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.ExecuteInternalAsync(Object[] arguments, CancellationTokenSource timeoutTokenSource) in /_/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs:391
Log snippets from WhenRealAppBuiltAndRunWithDevServer_RealConnectionEstablished:
MyApp -> C:\Users\AzDevOps\AppData\Local\Temp\7727796b-706d-49ae-801a-ab43e63376f1\MyApp\bin\Debug\net10.0-desktop\MyApp.dll
…
⚠️ Connection not detected in logs, but test may still be successful.
The real Skia app was built and launched successfully with devserver configuration.
DevServer output: Uno.UI.RemoteControl.Host: eager-loaded 2 assemblies from 'C:\a\1\s\src\Uno.UI.RemoteControl.Host\bin\Release\net11.0' (0 failures).
dbug: Uno.UI.RemoteControl.Host.Extensibility.AddIns[0]
Found target frameworks for solution 'C:\Users\AzDevOps\AppData\Local\Temp\7727796b-706d-49ae-801a-ab43e63376f1\MyApp.sln': net10.0-desktop.
…
dotnet --info output:
.NET SDK:
Version: 10.0.105
What I think is happening is that the test project is built *for*
.NET 10, *with* .NET 10, and something intermixed with all that is
trying to load assemblies built for *.NET 11*.
That feels like a recipe for failure, and explains the
"⚠️ Connection not detected" message.
A possible fix for that: update `SolutionHelper.cs` to do two things:
1. Update `dotnet` invocations to use `%DOTNET_INSTALL_DIR%\dotnet`
when `%DOTNET_INSTALL_DIR%` is set, which it *is* on CI.
2. Update the generated app so that (a) the `.csproj` targets
net11.0-* frameworks instead of the default net10.0-* frameworks,
and (b) the generated `global.json` allows .NET 11 to be used.
(1) should cause .NET 11 to be used to build the app, with (2)
being a prerequisites to allow .NET 11 to be used to build the app.
Update `RealAppLaunchIntegrationTests.cs` so that it resolves
assemblies from the net11.0 directory.
**Tests - Unit Tests > Run > Run unit tests** is failing for `Uno.UI.RemoteControl.DevServer.Tests.dll`: failed Telemetry_ProcessorDiscovery_Should_Load_Dependencies (22s 443ms) from C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\bin\Release\net11.0\Uno.UI.RemoteControl.DevServer.Tests.dll (net11.0|x64) Test method Uno.UI.RemoteControl.DevServer.Tests.Telemetry.TelemetryProcessorTests.Telemetry_ProcessorDiscovery_Should_Load_Dependencies threw exception: System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate) at Uno.UI.RemoteControl.DevServer.Tests.Telemetry.TelemetryProcessorTests.Telemetry_ProcessorDiscovery_Should_Load_Dependencies() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\Telemetry\TelemetryProcessorTests.cs:384 at Uno.UI.RemoteControl.DevServer.Tests.Telemetry.TelemetryProcessorTests.Telemetry_ProcessorDiscovery_Should_Load_Dependencies() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\Telemetry\TelemetryProcessorTests.cs:433 at Uno.UI.RemoteControl.DevServer.Tests.Telemetry.TelemetryProcessorTests.Telemetry_ProcessorDiscovery_Should_Load_Dependencies() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\Telemetry\TelemetryProcessorTests.cs:437 at Uno.UI.RemoteControl.DevServer.Tests.Telemetry.TelemetryProcessorTests.Telemetry_ProcessorDiscovery_Should_Load_Dependencies() in C:\a\1\s\src\Uno.UI.RemoteControl.DevServer.Tests\Telemetry\TelemetryProcessorTests.cs:437 at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestMethodInfo.ExecuteInternalAsync(Object[] arguments, CancellationTokenSource timeoutTokenSource) in /_/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs:391 Local repro command: dotnet build src/Uno.UI.RemoteControl.DevServer.Tests/Uno.UI.RemoteControl.DevServer.Tests.csproj && \ dotnet test --diagnostic --test-modules src/Uno.UI.RemoteControl.DevServer.Tests/bin/Debug/net11.0/Uno.UI.RemoteControl.DevServer.Tests.dll --filter "Name~Telemetry_ProcessorDiscovery_Should_Load_Dependencies" > o.txt 2>&1 After much beating my head against a wall, the useful sign was to compare to the output from running under .NET 10. *Note*: to get useful .NET 10 output, the test needs to actually fail, so force it: diff --git a/src/Uno.UI.RemoteControl.DevServer.Tests/Telemetry/TelemetryProcessorTests.cs b/src/Uno.UI.RemoteControl.DevServer.Tests/Telemetry/TelemetryProcessorTests.cs index ee293e8..5f4bba6331 100644 --- a/src/Uno.UI.RemoteControl.DevServer.Tests/Telemetry/TelemetryProcessorTests.cs +++ b/src/Uno.UI.RemoteControl.DevServer.Tests/Telemetry/TelemetryProcessorTests.cs @@ -380,6 +380,7 @@ public class TelemetryProcessorTests : TelemetryTestBase // This reproduces uno-private#1552 where the processor fails to load despite the dependency being present on disk telemetryProcessor.IsLoaded.Should().BeTrue($"Processor discovery should load dependencies located alongside the processor assembly, but got IsLoaded=false with LoadError: {telemetryProcessor.LoadError}"); telemetryProcessor.LoadError.Should().BeNull($"Processor discovery should not report load errors, but got: {telemetryProcessor.LoadError}"); + throw new Exception("Fail!"); } finally { Next, log file locations; when you need "moar input", look here! 1. `o.txt`, the output of `dotnet test` 2. `src/Uno.UI.RemoteControl.Host/bin/Debug/*/telemetry_processor_dependency_resolution*.log` 3. `src/Uno.UI.RemoteControl.DevServer.Tests/bin/Debug/*/TestResults/log_*` The useful breadcrumb when comparing `o.txt` between .NET 10 and .NET 11 invocations? The following message was present when running tests built for .NET 10 but not for .NET 11: dbug: Uno.UI.RemoteControl.Server.Processors.DefaultRemoteControlProcessorFactory[0] Discovery: Loading /var/folders/cx/nnhj5ww14xj10j5xclz6_9840000gn/T/uno-processor-test-bea9e61e6c5c4a5e8a2f682bcf469921/net10.0/Uno.Test.Processor.dll dbug: Uno.UI.RemoteControl.Server.Processors.DefaultRemoteControlProcessorFactory[0] Discovery: Registering Uno.UI.RemoteControl.TestProcessor.TelemetryTestProcessor Those messages led me to `DefaultRemoteControlProcessorFactory`, which had this fascinating code: var normalized = basePath.Replace('/', Path.DirectorySeparatorChar); #if NET10_0_OR_GREATER var candidate = Path.Combine(normalized, "net10.0"); #elif NET9_0_OR_GREATER var candidate = Path.Combine(normalized, "net9.0"); #else var candidate = normalized; #endif Noteably absent? `#if NET11_0_OR_GREATER` and a `Path.Combine()` that includes `net11.0`! What was happening is that we placed `Uno.Test.Processor.dll` into a `net11.0` directory, but that directory was never probed by `DefaultRemoteControlProcessorFactory`. Consequently, `Uno.Test.Processor.dll` was never loaded, which is why the test fails. Fix this by updating `DefaultRemoteControlProcessorFactory` to include a `NET11_0_OR_GREATER` block. @jonpryor: TODO for the inevitable .NET 12 migration: audit all use of `NET.*_OR_GREATER` to see if anything needs updating!
**Build - Managed Binaries > Build > Building WinAppSDK and Graphics3DGL package binaries** is failing: C:\a\1\s\src\AddIns\Uno.WinUI.Graphics2DSK\Uno.WinUI.Graphics2DSK.Windows.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. C:\a\1\s\src\Uno.UI.Toolkit\Uno.UI.Toolkit.Windows.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. C:\a\1\s\src\AddIns\Uno.WinUI.Graphics3DGL\Uno.WinUI.Graphics3DGL.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. Version 11.0.100-preview.5.26302.115 of the .NET SDK requires at least version 18.6.0 of MSBuild. The current available version of MSBuild is 18.4.0.7901. Change the .NET SDK specified in global.json to an older version that requires the MSBuild version currently available. The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json. MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.Sdk" because directory "C:\Program Files\Microsoft Visual Studio\18\Enterprise\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk" did not exist. The scenario is that we're using `msbuild` -- *not* `dotnet build` -- to build `Uno.WinUI.Graphics3DGL.csproj` and other projects, and MSBuild 18.6 is required to build `$(TargetFramework)`=net11.0 when using .NET 11 Preview 5. Update `$(windowsScaledPool)` to Windows2025-20260622-1, which is built from the [win25-vs2026/20260622.153][0] runner-images tag, which includes Visual Studio 2026 18.7.11911.148, and thus *should* likewise include *MSBuild* 18.7.11911.148. Hopefully this allows the **Build - Managed Binaries** stage to pass! [0]: https://github.com/actions/runner-images/blob/win25-vs2026/20260622.153/images/windows/Windows2025-VS2026-Readme.md#visual-studio-enterprise-2026
**Tests - Desktop Skia macOS > Runtime Tests > Run macOS Runtime Tests** is *crashing*: build/test-scripts/macos-skia-runtime-tests.sh: line 21: 25417 Segmentation fault: 11 dotnet SamplesApp.Skia.Generic.dll --runtime-tests=$TEST_RESULTS_FILE *Why?* No idea; we have no further log output. It doesn't crash locally. (Yet…) Follow the [xplat-minidump-generation][0] docs and export various environment variables so that "minidump"-related files are created in `BUILD_SOURCESDIRECTORY/build/uitests-failure-results`. This should allow "Publish Failed Tests Results" to publish the crash dumps, allowing further investigation. [0]: https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/botr/xplat-minidump-generation.md
…xists Good idea to enable use of createdump. Alas, it doesn't create the output directory, so it fails: [createdump] Can not create log file '/Users/runner/work/1/s/build/uitests-failure-results/createdump-macos.log': No such file or directory (2) Ensure `$BUILD_SOURCESDIRECTORY/build/uitests-failure-results` exists before trying to use it!
**Tests - Desktop Skia {Linux,Windows} > Runtime Tests** reports
many failued unit tests such as within
`When_AlcAppXaml_HasSourceDictionary_Then_ResolvesToAlcSpecificDictionary`:
Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. AlcApp build failed with exit code 1.
Output: Determining projects to restore...
All projects are up-to-date for restore.
_UnoBaseReferenceBinPath: D:\a\1\s/build/samplesapp-desktop-skia
D:\a\1\s\.dotnet\sdk\11.0.100-preview.5.26302.115\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(383,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\AlcApp\Uno.UI.RuntimeTests.AlcApp.csproj]
D:\a\1\s\.dotnet\sdk\11.0.100-preview.5.26302.115\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\AlcApp\obj\project.assets.json' doesn't have a target for 'net11.0'. Ensure that restore has run and that you have included 'net11.0' in the TargetFrameworks for your project. [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\AlcApp\Uno.UI.RuntimeTests.AlcApp.csproj]
Build FAILED.
D:\a\1\s\.dotnet\sdk\11.0.100-preview.5.26302.115\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file 'D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\AlcApp\obj\project.assets.json' doesn't have a target for 'net11.0'. Ensure that restore has run and that you have included 'net11.0' in the TargetFrameworks for your project. [D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\AlcApp\Uno.UI.RuntimeTests.AlcApp.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.27
Error:
at Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Fail(String message) in /_/src/TestFramework/TestFramework/Assertions/Assert.Fail.cs:line 25
at Uno.UI.RuntimeTests.Tests.AssemblyLoadContext.Given_AlcContentHost.BuildAlcAppAsync() in D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\Given_AlcContentHost.cs:line 1687
at Uno.UI.RuntimeTests.Tests.AssemblyLoadContext.Given_AlcContentHost.StartSecondaryAlcAppAsync(String[] launchArguments) in D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\Given_AlcContentHost.cs:line 1533
at Uno.UI.RuntimeTests.Tests.AssemblyLoadContext.Given_AlcContentHost.When_AlcAppXaml_HasSourceDictionary_Then_ResolvesToAlcSpecificDictionary() in D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\AssemblyLoadContext\Given_AlcContentHost.cs:line 282
at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_2.<<ExecuteTestsForInstance>g__InvokeTestMethod|5>d.MoveNext() in D:\a\1\s\src\SamplesApp\SamplesApp.UnitTests.Shared\Controls\UnitTest\UnitTestsControl.cs:line 1035
`Uno.UI.RuntimeTests.AlcApp.csproj` had `$(TargetFramework)`=net10.0.
This presumably needs to be updated to net11.0.
Meanwhile, an earlier commit in this PR mentioned:
> * When it makes sense to do so, use `$(NetPrevious)` and
> `$(NetCurrent)` instead of hardcoding target frameworks.
The exception to this is `src/SolutionTemplate`. Everywhere else,
when practical and known to import top-level `Directory.Build.props`,
should use `$(NetPrevious)` and `$(NetCurrent)` to simplify future
.NET bumps:
% git grep -i '<targetframework.*net10' src | grep -v SolutionT
Context: #23332 **Tests - Templates macOS Tests * > Run Project Template Tests** is failing on CI, for Linux, macOS, and Windows, a'la: Executing: dotnet build -v:m -p:AotAssemblies=false -p:Configuration=Debug "5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj" -f net11.0 -bl … Restored /Users/runner/work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj (in 38.24 sec). /Users/runner/work/1/s/.dotnet/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(383,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/Users/runner/work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0] /Users/runner/work/1/s/.dotnet/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file '/Users/runner/work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/obj/project.assets.json' doesn't have a target for 'net11.0'. Ensure that restore has run and that you have included 'net11.0' in the TargetFrameworks for your project. [/Users/runner/work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0] Build FAILED. /Users/runner/work/1/s/.dotnet/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file '/Users/runner/work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/obj/project.assets.json' doesn't have a target for 'net11.0'. Ensure that restore has run and that you have included 'net11.0' in the TargetFrameworks for your project. [/Users/runner/work/1/s/src/SolutionTemplate/5.3/uno53net9blank/uno53net9blank/uno53net9blank.csproj::TargetFramework=net11.0] 0 Warning(s) 1 Error(s) The cause of the NETSDK1005 is that the projects are being built for .NET 11 (`… -f net11.0`), but their `$(TargetFrameworks)` value doesn't contain net11.0, only net10.0. Update `src/SolutionTemplates` so that the projects target net11.0*.
Recall "chore: avoid Task.Wait() on SkiaWasm"? In which
`EventTester.cs` was updated to avoid `Task.Wait()` invocations on
WebAssembly + Skia ("SkiaWasm"), and did this by updating
`ConditionalTestHelper.CurrentPlatform`?
That change breaks on "Desktop Skia Linux" and
"Desktop Skia Linux Framebuffer"
System.InvalidOperationException: Unrecognized runtime platform.
at Microsoft.VisualStudio.TestTools.UnitTesting.ConditionalTestHelper.GetCurrentPlatform() in D:\a\1\s\src\Uno.UI.RuntimeTests\Helpers\ConditionalTestHelper.cs:line 28
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
--- End of stack trace from previous location ---
at System.LazyHelper.ThrowException()
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at Microsoft.VisualStudio.TestTools.UnitTesting.ConditionalTestHelper.get_CurrentPlatform() in D:\a\1\s\src\Uno.UI.RuntimeTests\Helpers\ConditionalTestHelper.cs:line 10
at Microsoft.UI.Xaml.Tests.Common.EventTester`2..ctor(TSender sender, Type senderType, String eventName, Action`2 action, EventTesterOptions options, Boolean setBVTflags) in D:\a\1\s\src\Uno.UI.RuntimeTests\MUX\Helpers\EventTester.cs:line 113
at Microsoft.UI.Xaml.Tests.Common.EventTester`2..ctor(TSender sender, Type senderType, String eventName, Action`2 action, EventTesterOptions options) in D:\a\1\s\src\Uno.UI.RuntimeTests\MUX\Helpers\EventTester.cs:line 143
at Microsoft.UI.Xaml.Tests.Common.EventTester`2..ctor(TSender sender, String eventName, Action`2 action) in D:\a\1\s\src\Uno.UI.RuntimeTests\MUX\Helpers\EventTester.cs:line 160
at Microsoft.UI.Xaml.Tests.Common.EventTester`2..ctor(TSender sender, String eventName) in D:\a\1\s\src\Uno.UI.RuntimeTests\MUX\Helpers\EventTester.cs:line 179
at Uno.UI.RuntimeTests.MUX.Input.Focus.FocusHelper.EnsureFocusAsync(UIElement element, FocusState focusState, UInt32 Attempts) in D:\a\1\s\src\Uno.UI.RuntimeTests\MUX\Input\Focus\FocusHelper.cs:line 77
at Uno.UI.RuntimeTests.MUX.Input.Focus.FocusTests.ElementMovesToCorrectElementWhenFocusedElementCollapsed() in D:\a\1\s\src\Uno.UI.RuntimeTests\MUX\Input\Focus\FocusTests.cs:line 1403
at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass74_2.<<ExecuteTestsForInstance>g__InvokeTestMethod|5>d.MoveNext() in D:\a\1\s\src\SamplesApp\SamplesApp.UnitTests.Shared\Controls\UnitTest\UnitTestsControl.cs:line 1035
When discussing appropriate fixes for `EventTester.cs`,
@MartinZikmund suggested that `OperatingSystem.IsBrowser()` be used
instead of updating `ConditionalTestHelper.CurrentPlatform`.
Unfortunately this suggestion came *after* I had already tried updating
`ConditionalTestHelper.CurrentPlatform`, but now that the fix itself
causes problems elsewhere…
Update `EventTester.cs` to use `OperatingSystem.IsBrowser()` instead
of `ConditionalTestHelper.CurrentPlatform`.
Update `ConditionalTestHelper.cs` so that exceptions provide more
information if (when) they throw.
88233f0 to
4a93dd4
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
This reverts commit "chore: update SolutionTemplate to target net11.0", and partially reverts "chore: Update to .NET 11 Preview 5". The problem: dotnet/macios#25867 Specifically, `uno53net9blank.csproj` (and others?) does not build when targeting net11.0-ios, erroring out in ReadyToRun processing: Restore complete (0.4s) info NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy uno53net9blank net11.0-ios iossimulator-arm64 failed with 14 error(s) and 1 warning(s) (15.0s) → uno53net9blank/bin/Debug/net11.0-ios/iossimulator-arm64/uno53net9blank.dll $HOME/Developer/tmp/_macios/uno53net9blank/uno53net9blank/ControlWithXamlEverywhereExceptDesktop.xaml.cs(11,11): warning Uno0006: Type 'uno53net9blank.ControlWithXamlEverywhereExceptDesktop' should call 'InitializeComponent()' from its constructor (https://aka.platform.uno/UNO0006) $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error Error: Failed to load assembly 'Microsoft.Extensions.Primitives' $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error Internal.TypeSystem.TypeSystemException+FileNotFoundException: Failed to load assembly 'Microsoft.Extensions.Primitives' $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at Internal.TypeSystem.ThrowHelper.ThrowFileNotFoundException(ExceptionStringID, String) in /_/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/ThrowHelper.cs:line 41 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at Internal.TypeSystem.ResolutionFailure.Throw() in /_/src/runtime/src/coreclr/tools/Common/TypeSystem/Common/ResolutionFailure.cs:line 105 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.ReadyToRunVisibilityRootProvider.GetAllMethodImplRecordsForType(EcmaType) in /_/src/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunVisibilityRootProvider.cs:line 132 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.ReadyToRunVisibilityRootProvider.RootMethods(MetadataType, String, IRootingServiceProvider, Boolean) in /_/src/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunVisibilityRootProvider.cs:line 50 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.ReadyToRunVisibilityRootProvider.AddCompilationRoots(IRootingServiceProvider) in /_/src/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunVisibilityRootProvider.cs:line 39 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.Compilation..ctor(DependencyAnalyzerBase`1, NodeFactory, IEnumerable`1, ILProvider, DevirtualizationManager, IEnumerable`1, Logger, InstructionSetSupport) in /_/src/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 68 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.ReadyToRunCodegenCompilation..ctor(DependencyAnalyzerBase`1, NodeFactory, IEnumerable`1, ILProvider, Logger, DevirtualizationManager, IEnumerable`1, String, InstructionSetSupport, Boolean, Boolean, Boolean, Boolean, Func`2, String, Boolean, String, Int32, Boolean, Int32, ProfileDataManager, MethodLayoutAlgorithm, FileLayoutAlgorithm, Int32, Boolean, ReadyToRunContainerFormat) in /_/src/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs:line 358 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.ReadyToRunCodegenCompilationBuilder.ToCompilation() in /_/src/runtime/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs:line 330 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.Program.RunSingleCompilation(Dictionary`2, InstructionSetSupport, String, Dictionary`2, HashSet`1, ReadyToRunCompilerContext, Logger) in /_/src/runtime/src/coreclr/tools/aot/crossgen2/Program.cs:line 691 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.Program.Run() in /_/src/runtime/src/coreclr/tools/aot/crossgen2/Program.cs:line 314 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(515,5): error at ILCompiler.Crossgen2RootCommand.<>c__DisplayClass223_0.<.ctor>b__0(ParseResult) in /_/src/runtime/src/coreclr/tools/aot/crossgen2/Crossgen2RootCommand.cs:line 280 $HOME/Downloads/dotnet-sdk-11.0.100-preview.5.26302.115/sdk/11.0.100-preview.5.26302.115/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(390,5): error NETSDK1096: Optimizing assemblies for performance failed. You can either exclude the failing assemblies from being optimized, or set the PublishReadyToRun property to false. Build failed with 14 error(s) and 1 warning(s) in 15.6s In the interest of expediency, keep the SolutionTemplate tests on net10.0*. We'll revisit targeting net11.0* in the future.
4a93dd4 to
8df2e0d
Compare
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23479/wasm-skia-net9/index.html |
|
|
|
Superseded by #23603, in large part because this PR drops support for .NET 9, which is a breaking change. |
Context: #22745 Context: unoplatform/uno.templates#1992 Context? 69cc392
It's that time of year again! .NET 11 previews are out; does Uno work with .NET 11? Let's find out!
Build system changes and notes:
Centralize NuGet package versions for the Microsoft.Build* and Microsoft.CodeAnalysis* NuGet packages.
Leave
FontFallbackPreprocessor.csprojtargeting net10.0, as this job never provisions .NET itself, and .NET 10 is pre-installed on that CI bot.Update
$(macOSVMImage)to usemacOS-26(up frommacOS-15). dotnet/macios in .NET 11 now requires Xcode 26.5, and only the macOS-26 runner-image provides Xcode 26.5.x.When it makes sense to do so, use
$(NetPrevious)and$(NetCurrent)instead of hardcoding target frameworks.When it doesn't make sense to do so: specifying NuGet package versions, which are normally only bumped when the .NET version changes, and it makes things clearer that these are related by using explicit .NET versions and not using
$(Net*).Introduce new
$(NetPreviousAppleOSVersion)and$(NetCurrentAppleOSVersion)MSBuild properties to avoid hardcoding Apple OS versions.net11.0-ios and net11.0-tvos bump the minimum supported
$(SupportedOSPlatformVersion)value to 13.0.Bump
Microsoft.CodeAnalysis.CSharp.SourceGenerators.TestingNuGet package version to 1.1.3, so that we can use e.g.ReferenceAssemblies.Net.Net100.Bump
System.Security.Cryptography.XmlNuGet package version to 10.0.0, as newerMicrosoft.CodeAnalysisNuGet packages require that System.Security.Cryptography.Xml be >= 9.0.Bump NuGet Package versions for .NET 11 Android; resolves:
However, updating those package versions means we need to bump
$(SupportedOSPlatformVersion)to 24 (up from 21). Update that inUno.CrossTargetting.targets, and remove$(SupportedOSPlatformVersion)fromSamplesApp*.netcoremobile.csprojas those are "confusing noise"; they're not used, asUno.CrossTargetting.targetsalways replaces.Also update
//uses-sdk/@android:minSdkVersionin variousAndroidManifest.xmlto be at least 24.Some of the updated .NET 11 Android NuGet packages also broke API in various ways; update
UnoExploreByTouchHelper.cs/etc. to compensate.Update
src/Uno.UWP/Uno.netcoremobile.csprojto add an explicit@(PackageReference)to Xamarin.AndroidX.DocumentFile. This was previously implicitly brought in by [email protected], but we can't use that version anymore due to NU1703 warnings:The updated Xamarin.AndroidX.DocumentFile in turn has changes to nullability and obsoletions, requiring changes.
Fix NU1510 errors by removing
@(PackageReference)s for the mentioned packages: Microsoft.Extensions.Logging.Abstractions, Microsoft.CSharp, System.Formats.Asn1, System.Net.Http, System.Text.RegularExpressions.Set
$(AndroidLinkTool)=r8 in SamplesApp projects for net11.0-android. This works around a crash in r8. TODO: upstream URL.Reminder:
.azure-devops-tests-ios-skia-build.ymlmust be consistent withskia-ios-uitest-build.sh.Source code changes:
Apple platforms such as net11.0-ios26.5 have changed nullability of methods such as
NSObject.FromObject(). Compensate.While updating nullability, also update nearby logic errors.
UnoWKWebView.ProcessNavigation()callsrelativePath.Substring(1)ifrelativePathstarts with a/, but if it were to start with multiple slashes, the result would still start with a slash. UseresultPath.TrimStart('/')instead.SvgImageSource.OpenSvgBundle()could havefileExtension==""and would then callfileExtension.Substring(1), which could throw. UsefileExtension.TrimStart('.')instead.object.ToString()has long returned nullablestring?, but only now is it apparently impactingNativeCoreWebView2HttpRequestHeaders.iOS.cs. (Go figure.).NET 11 has new IDE0055 warnings for pre-existing constructs; in particular,
else ifmust be on the same line, and#region/#endregionmust have matching indentation.Update various files to fix these warnings.
The updated Xamarin.AndroidX.DocumentFile NuGet package has nullability changes. Adapt.
Trimmer fixes! TODO description.
Update
Given_BrowserKeyboardInputSource.csto useType.GetType(string)instead ofAppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(…).GetType(…)to fix IL2026 and IL2072 warnings:Update
SamplesApp.netcoreapp.csprojto ignore IL2026 warnings fromSystem.Data:Commands to migrate from net9+net10 to net10+net11, for posterity:
@(PackageReference)needs to be reviewed, as the above "in-place" updates mean that "net10.0" is using the same packages as "net9.0", which are almost certainly wrong. To easily find files to review:To sanity-check locally, try:
TODO:
RealAppLaunchIntegrationTests.cs._targetFrameworkto net11.0.GitHub Issue: closes #
PR Type:
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.