Skip to content

chore: Update to .NET 10 Preview 6#21140

Closed
jonpryor wants to merge 16 commits intomasterfrom
dev/jonp/jonp-build-with-net10
Closed

chore: Update to .NET 10 Preview 6#21140
jonpryor wants to merge 16 commits intomasterfrom
dev/jonp/jonp-build-with-net10

Conversation

@jonpryor
Copy link
Contributor

Context: #19934
Context: dotnet/sdk#48949
Context: dotnet/android@70bd636

#19934 was the first attempt to build unoplatform/uno with .NET 10. It currently builds (mostly), but it has lots of unit test failures (over 3700).

Reviewing the diff between master@8e93e0d5 and
dev/jela/ref-updates@81c222f90c9704233ed2a8e0e8ee258dbda4c8e6 shows lots of changes which are apparently unrelated to getting Uno building atop .NET 10. Could some of those changes be responsible?

Test out this hypothesis by applying the .NET 10 changes to a new branch + PR, which will allow us to see determine if just building atop .NET 10 is the cause of the unit test failures.

To be clear, ".NET 10 changes" still constitutes a lot of changes. Broadly speaking, they fall under:

  • $(TreatWarningsAsErrors)=true + NuGet warnings. For example:

    error NU1510: Warning As Error:
    PackageReference System.Private.Uri will not be pruned.
    Consider removing this package from your dependencies, as it is likely unnecessary.
    
  • $(TreatWarningsAsErrors)=true + IDE0055 warnings, which mostly involved adding blank lines between namespace … declarations and type declarations.

  • $(TreatWarningsAsErrors)=true + CS8604 warnings due to nullability changes, particularly in iOS.

  • $(TreatWarningsAsErrors)=true + IL2* warnings, some of which I was able to fix in a reasonable timeframe, and some of which I just threw into $(NoWarn) to deal with later.

  • Workarounds for EnableWindowsTargeting is broken in .NET 10 Preview 4 (Microsoft.WindowsDesktop.App.Ref not found) dotnet/sdk#48949, specifically altering %(KnownFrameworkReference.*Version) metadata so that the correct version of Microsoft.WindowsDesktop.App.Ref is found.

  • Workarounds for dotnet/android@70bd636b, which introduced a new Microsoft.Android namespace into Mono.Android.dll, which causes a CS0234 error when inside a Microsoft. namespace and C# code tries to use e.g. Android.Views.View.

  • Use .NET 9 to run dotnet tool update on Linux, to avoid:

    Unhandled exception: Command workload has more than one child named "--info"
    

    This will hopefully be fixed in .NET 10 Preview 7.

GitHub Issue: closes #

PR Type:

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

@github-actions github-actions bot added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/code-generation Categorizes an issue or PR as relevant to code generation area/build Categorizes an issue or PR as relevant to build infrastructure area/automation Categorizes an issue or PR as relevant to project automation platform/wpf 🪟 Categorizes an issue or PR as relevant to WPF kind/documentation area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk labels Jul 23, 2025
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21140/wasm-skia-net9/index.html

@jonpryor jonpryor force-pushed the dev/jonp/jonp-build-with-net10 branch from 2666ac6 to 6570e1b Compare July 23, 2025 20:25
Context: #19934
Context: dotnet/sdk#48949
Context: dotnet/android@70bd636

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It currently *builds* (mostly), but it has *lots* of
unit test failures (over 3700).

Reviewing the diff between master@8e93e0d5 and
dev/jela/ref-updates@81c222f90c9704233ed2a8e0e8ee258dbda4c8e6
shows lots of changes which are apparently unrelated to getting Uno
building atop .NET 10.  Could some of those changes be responsible?

Test out this hypothesis by applying the .NET 10 changes to a
*new* branch + PR, which will allow us to see determine if *just*
building atop .NET 10 is the cause of the unit test failures.

To be clear, ".NET 10 changes" still constitutes *a lot* of changes.
Broadly speaking, they fall under:

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + IDE0055 warnings, which mostly
    involved adding blank lines between `namespace …` declarations
    and type declarations.

  * `$(TreatWarningsAsErrors)`=true + CS8604 warnings due to
    nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which I
    was able to fix in a reasonable timeframe, and some of which I
    just threw into `$(NoWarn)` to deal with later.

  * Workarounds for dotnet/sdk#48949, specifically altering
    `%(KnownFrameworkReference.*Version)` metadata so that the
    correct version of `Microsoft.WindowsDesktop.App.Ref` is found.

  * Workarounds for dotnet/android@70bd636b, which introduced a new
    `Microsoft.Android` namespace into `Mono.Android.dll`, which causes
    a CS0234 error when inside a `Microsoft.` namespace and C# code
    tries to use e.g. `Android.Views.View`.

  * Use .NET 9 to run `dotnet tool update` on Linux, to avoid:

        Unhandled exception: Command workload has more than one child named "--info"

    [This will hopefully be fixed in .NET 10 Preview 7][0].

[0]: https://discord.com/channels/732297728826277939/1267023991428612199/1397307201919652023
@jonpryor jonpryor force-pushed the dev/jonp/jonp-build-with-net10 branch from 6570e1b to 5c30676 Compare July 23, 2025 20:36
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21140/wasm-skia-net9/index.html

**Tests - Unit Tests > Run > Build unit tests solution filter** was
failing with:

	C:\a\1\s\src\Uno.UI.RemoteControl.TestProcessor\Uno.UI.RemoteControl.TestProcessor.csproj :
	error NU1201: Project Uno.UI.RemoteControl.Server is not compatible with net8.0 (.NETCoreApp,Version=v8.0).
	  Project Uno.UI.RemoteControl.Server supports:
	    - net10.0 (.NETCoreApp,Version=v10.0)
	    - net9.0 (.NETCoreApp,Version=v9.0)

This is because `Uno.UI.RemoteControl.TestProcessor.csproj` was
explicitly targeting `net8.0`, while its dependencies were using
`$(NetPrevious);$(NetCurrent)`.

Update `Uno.UI.RemoteControl.TestProcessor.csproj` to use
`$(NetPrevious)`, so that we don't need to worry about it in the future.

Fix new IDE0055 warnings.

Review `git grep net8.0` output.  Ignoring `.nuspec` files and
`src/SolutionTemplate`, the only remaining use of `net8.0` is in
`src/Uno.UWPSyncGenerator/Generator.cs`, a'la:

	_androidCompilation = await LoadProject($@"{topProject}.netcoremobile.csproj", "net8.0-android");

Update these to `net9.0`, just in case.
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21140/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 171690 has failed on Uno.UI - CI.


# CA1863: Use composite format
# TODO: Enable when we are .NET 8+ to avoid conditional code between net7.0 and net8.0
# TODO: Enable when we are .NET 8+ to avoid conditional code between net7.0 and net9.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment no longer makes sense. Consider opening an issue to track enabling this analyzer.

@github-actions github-actions bot added the area/solution-templates Categorizes an issue or PR as relevant to the solution template label Jul 24, 2025
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21140/wasm-skia-net9/index.html

@jonpryor jonpryor force-pushed the dev/jonp/jonp-build-with-net10 branch from 11cc0c0 to 22815eb Compare July 24, 2025 16:00
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21140/wasm-skia-net9/index.html

jonpryor added 2 commits July 24, 2025 14:54
**Tests - Templates > macOS Tests group_1 > Run Project Template Tests**
was failing with:

	error NETSDK1147: To build this project, the following workloads must be installed: android-net8
	error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

Uno only supports two .NET versions, `$(NetCurrent)` and
`$(NetPrevious)`.  With the addition of .NET 10, that means that .NET 8
falls out of support, and thus we should not be building these projects
against .NET 8.

Some of the `src/SolutionTemplate` projects already made use of a
`$(DotNetVersion)` property.

Add new `$(DotNetCurrentVersion)` and `$(DotNetPreviousVersion)`
MSBuild properties to  `src/SolutionTemplate/Directory.Build.props`
so that .NET versions can be used consistently, with
`$(DotNetPreviousVersion)`=net9.0, `$(DotNetCurrentVersion)`=net10.0.
This allows nearly everything else to be based upon these new
properties, e.g. `net8.0-android` becomes
`$(DotNetPreviousVersion)-android`, which should make it easier to
bump this value in the future.

Update use of `net8.0-android34.0` to `net9.0-android35.0`.
Export and use `$ANDROID_AVD_HOME`, so that we have a "known" location
for whare Emulator images are created.  (Not sure what's wrong with
my environment, but they are not reliably created or loaded from
`$HOME/.android/avd`.)

Update `local-android-uitest-run.sh` so that it doesn't require running
the script from the `build/test-scripts` directory.  You can now run it
from topdir:

	UITEST_IS_LOCAL=true \
	  build/test-scripts/local-android-uitest-run.sh

Update the expected paths to match .NET 9 output.
@jonpryor jonpryor force-pushed the dev/jonp/jonp-build-with-net10 branch from 22815eb to 5893bfe Compare July 24, 2025 19:49
@unodevops
Copy link
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21140/wasm-skia-net9/index.html

@unodevops
Copy link
Contributor

⚠️⚠️ The build 171806 has failed on Uno.UI - CI.

jonpryor added 2 commits July 24, 2025 21:10
Context: 5c30676
Context: #19934

The **Tests - Desktop Skia Windows > … > Using .NET 10.0 global.json**
and **Tests - Desktop Skia Linux > … > Using .NET 10 global.json**
steps are each failing, for the same reason:

	rm: cannot remove 'global.json': No such file or directory
	cp: cannot stat 'build/ci/net10/global.json': No such file or directory

The reason why this step is failing is twofold:

 1. Each of those jobs have `checkout: none`, i.e. they do not check
    out the `unoplatform/uno` repo, and

 2. They each run the `dotnet-install.yml` template, which in turn is
    trying to access files from the (nonexistent!) checkout.

This change was introduced in commit 5c30676, which in turn was
"cribbed" from #19934.

Is the inclusion of `dotnet-install.yml` necessary?

Remove it, and let's find out!
The **Tests - Desktop Skia Windows > Runtime Tests** step fails:

	HRAppBuild: D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.csproj :
	error NU1015: The following PackageReference item(s) do not have a version specified: Uno.Fonts.OpenSans
	HRAppBuild: D:\a\1\s\src\Uno.UI.RuntimeTests\Tests\HotReload\Frame\HRApp\Uno.UI.RuntimeTests.HRApp.Skia.csproj :
	warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

Address these messages:

  * Add `%(Version)` metadata for the `Uno.Fonts.OpenSans` package.
  * Remove the `@(PackageReference)` for `Microsoft.Win32.Registry`.
jonpryor added a commit that referenced this pull request Aug 13, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 now requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 14, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 now requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 14, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Update `SamplesApp.UITests.csproj` to explicitly use
    Microsoft.NET.Test.Sdk 17.14.1, to "override" the nearly four
    year old Microsoft.NET.Test.Sdk 17.0.0 reference implicitly
    brought in from Uno.UITest.Helpers/1.1.0-dev.70.

    This hopefully fixes a `MissingMethodException` for
    `IFileSystem.Exists(string)` seen on CI:

        Unhandled exception. System.MissingMethodException: Method not found: 'Boolean Microsoft.Testing.Platform.Helpers.IFileSystem.Exists(System.String)'.
           at Microsoft.Testing.Extensions.VSTestBridge.Configurations.RunSettingsConfigurationProvider.BuildAsync(CommandLineParseResult commandLineParseResult)
           at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
           at Microsoft.Testing.Extensions.VSTestBridge.Configurations.RunSettingsConfigurationProvider.BuildAsync(CommandLineParseResult commandLineParseResult)
           at Microsoft.Testing.Platform.Configurations.ConfigurationManager.BuildAsync(IFileLoggerProvider syncFileLoggerProvider, CommandLineParseResult commandLineParseResult) in /_/src/Platform/Microsoft.Testing.Platform/Configurations/ConfigurationManager.cs:line 37
           at Microsoft.Testing.Platform.Hosts.TestHostBuilder.BuildAsync(ApplicationLoggingState loggingState, TestApplicationOptions testApplicationOptions, IUnhandledExceptionsHandler unhandledExceptionsHandler, DateTimeOffset createBuilderStart) in /_/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs:line 131
           at Microsoft.Testing.Platform.Builder.TestApplicationBuilder.BuildAsync() in /_/src/Platform/Microsoft.Testing.Platform/Builder/TestApplicationBuilder.cs:line 112
           at TestingPlatformEntryPoint.Main(String[] args) in /__w/1/s/src/SamplesApp/SamplesApp.UITests/obj/Release/net9.0/TestPlatformEntryPoint.cs:line 14
           at TestingPlatformEntryPoint.<Main>(String[] args)

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 14, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    This can make it annoyingly difficult to `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 14, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    This can make it annoyingly difficult to `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 14, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 15, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 18, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 18, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 18, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 18, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 25, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 25, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 25, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 25, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jonpryor added a commit that referenced this pull request Aug 26, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jonpryor added a commit that referenced this pull request Aug 26, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
jeromelaban pushed a commit that referenced this pull request Aug 27, 2025
Context: #19934
Context: #21140
Context: dotnet/sdk#48949

#19934 was the first attempt to build unoplatform/uno
with .NET 10.  It *built* (mostly), but it had *lots* of unit test
failures (over 3700) that were not understood at the time.

#21140 was an attempt to cleanup & simplify #19934.
It partially succeeded, but required additional reconsideration for
a cleaner and more understandable merge.

(Later, PR #21183 helped explain many of the unit test failures that
PR #19934 observed: Xamarin.UITest doesn't work reliably under
.NET 9! See microsoft/appcenter#2646 and microsoft/appcenter#327!)

Some of the contents of #19934 and #21140 have been split out into
separately merged PRs such as #21230 (CS0246 fixes)
and #21199 (remove `[Export]` in some scenarios).

Squash existing "known good" and related changes:

  * doc updates

  * Bumping target framework versions,

  * Use uno.check 1.32.0-dev.45, which knows about .NET 10 Preview 7.

  * `$(TreatWarningsAsErrors)`=true +
    NuGet warnings.  For example:

        error NU1510: Warning As Error:
        PackageReference System.Private.Uri will not be pruned.
        Consider removing this package from your dependencies, as it is likely unnecessary.

  * `$(TreatWarningsAsErrors)`=true + CS8604 or CS0809 warnings due
    to nullability changes, particularly in iOS.

  * `$(TreatWarningsAsErrors)`=true + IL2\* warnings, some of which
    @jonpryor was able to fix in a reasonable timeframe, and some of
    which was thrown into `$(NoWarn)` to deal with later.

  * Remove hardcoded `$(TargetFramework)`=net8.0 from
    `Uno.UI.RemoteControl.TestProcessor.csproj`, so that it builds,
    and remove other uses of `net8.0` from everywhere other than
    `src/SolutionTemplate`.

  * Provide `%(PackageReference.Version)` for packages that were
    producing NU1015 errors, specifically `Uno.Fonts.OpenSans`.

  * Remove `@(PackageReference)` values which produced NU1510
    warnings such as:

        warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.

  * Improve `dotnet-install.yml` use, as some CI environments *don't*
    have a `unoplatform/uno` checkout, and thus *cannot* copy files
    such as `build/ci/net10/global.json`.

  * Improve `local-android-uitest-run.sh` for local macOS use:
    Export and use `$ANDROID_AVD_HOME`, so that we have a "known"
    location for whare Emulator images are created.  (Not sure what's
    wrong with my environment, but they are not reliably created or
    loaded from `$HOME/.android/avd`.)

    Also update so that it doesn't require running the script from the
    `build/test-scripts` directory.  You can now run it from topdir:

        UITEST_IS_LOCAL=true \
          build/test-scripts/local-android-uitest-run.sh

  * Provision OpenJDK-17, as .NET 9 requires it.

  * Use Xcode 16.4, as .NET 10 iOS now requires it.

  * Add new `$(NetPreviousNetCoreApple)` MSBuild property to
    `Directory.Build.props`, which contains target frameworks for
    $(NetPrevios) Apple platforms.

    Update `Uno.UI.Runtime.Skia.AppleUIKit.csproj` to use
    `$(NetPreviousNetCoreApple)`, and update `skia-ios-uitest-build.sh`
    to provide a "complete" target framework version.

    This is so that target frameworks are consistent:
    `net9.0-ios` *floats*; circa a year ago, it aliased
    `net9.0-ios18.0`, and *today* it aliases `net9.0-ios18.5`.
    "Even better", this doesn't "flow" to the C# compiler:
    `net9.0-ios` sets `IOS18_0_OR_GREATER` *but not*
    `IOS18_5_OR_GREATER` *even when* the 18.5 assemblies are used!
    This can make it annoyingly difficult to get `[Obsolete]`s
    consistent across separate project builds.

TODO, for future commits to this PR:

  * Xamarin.AndroidX package version bumps from #21205.
    We felt that these shouldn't be separately merged, as some of
    version bumps are quite significant and should instead only be
    used with .NET 10.

  * A new understanding of `src/SolutionTemplate`: the intent, as
    @jonpryor currently understands it, is that tests within
    `src/SolutionTemplate` are "frozen in time"; `$(TargetFrameworks)`
    should *not* be updated, etc.

    Which means that when we drop support for an older version of .NET,
    we should in turn *remove the old tests*.
jeromelaban pushed a commit that referenced this pull request Aug 27, 2025
Context: #21205
Context: #21140
Context: unoplatform/uno-private#1422
Context: dotnet/java-interop@356485e

While exploring the use of NativeAOT on Android for .NET 10, a sticking
point is that running within an Android+NativeAOT environment requires
the use of a new "style" of bindings; see dotnet/java-interop@356485ee.

The new style requires .NET 10.

However, the various Xamarin.AndroidX packages have been updated to
provide bindings for *both* .NET 8 *and* .NET 10 previews, which allows
apps targeting .NET 10 to begin exploring NativeAOT use.

Update the required Xamarin.AndroidX NuGet package versions to versions
which provide both .NET 8 and .NET 10 binaries, but *only* for
.NET 10 target frameworks.  .NET 9 targets continue. using the previous
NuGet package versions.

Additionally, the Xamarin.AndroidX.Browser NuGet package:
[Xamarin.AndroidX.Browser/1.0.0][0] has a dependency on
Xamarin.AndroidX.Legacy.Support.Core.UI, which eventully pulls in
Xamarin.AndroidX.DocumentFile. [Xamarin.AndroidX.Browser/1.8.0.10][1]
*does not*.  The Xamarin.AndroidX.Legacy.Support.Core.UI dependency
was removed in Xamarin.AndroidX.Browser/1.2.0.

Fix a CS0246 error in `StorageFolder.saf.Android.cs` by explicitly
adding a reference to Xamarin.AndroidX.DocumentFile.

Finally, fix some nullability and `[Obsolete]` errors caused by using
a newer Xamarin.AndroidX.DocumentFile package.

[0]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.0.0#dependencies-body-tab
[1]: https://www.nuget.org/packages/Xamarin.AndroidX.Browser/1.8.0.10#dependencies-body-tab
@github-actions
Copy link

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions bot added the stale This item has been marked as stale and will be closed if there is no activity. label Sep 29, 2025
@jeromelaban jeromelaban closed this Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/build Categorizes an issue or PR as relevant to build infrastructure area/code-generation Categorizes an issue or PR as relevant to code generation area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk area/skia ✏️ Categorizes an issue or PR as relevant to Skia area/solution-templates Categorizes an issue or PR as relevant to the solution template kind/documentation platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform platform/wpf 🪟 Categorizes an issue or PR as relevant to WPF stale This item has been marked as stale and will be closed if there is no activity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants