Skip to content

[mobile] .NET 11 mobile runtime configuration updates#11632

Open
kotlarmilos wants to merge 13 commits into
mainfrom
dev/update-sdk-mobile
Open

[mobile] .NET 11 mobile runtime configuration updates#11632
kotlarmilos wants to merge 13 commits into
mainfrom
dev/update-sdk-mobile

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Jun 11, 2026

Copy link
Copy Markdown
Member

Description

Remove the Mono mobile test legs from build-tools, and drop the Microsoft.NET.Workload.Mono.Toolchain manifest dependency from eng/Version.Details.xml and eng/Versions.props.

Validation pipelines (must pass): dotnet-android (devdiv pipeline 12278) PR build.

Validation pins (temporary): pinned to .NET 11 test build 11.0.100-preview.6.26310.106 (AzDO dotnet-unified-build run 2996804, BAR 318158, source dotnet/dotnet@8d5d82abe13, branch dev/update-sdk-mobile-stage2) and the public general-testing NuGet feed, so CI exercises the SDK with the Mono mobile workloads and RIDs removed.

TODO before merge: revert the global.json / Version.Details.xml / Versions.props pins and the NuGet.config feed back to the official VMR versions and the main feed.

@kotlarmilos

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@kotlarmilos kotlarmilos marked this pull request as ready for review June 12, 2026 09:58
Copilot AI review requested due to automatic review settings June 12, 2026 09:58
@kotlarmilos kotlarmilos self-assigned this Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the repo’s .NET 11 “mobile runtime” configuration by removing Mono mobile-related dependencies (notably the Mono toolchain workload manifest) and pruning CI/build tooling paths that were exercising Mono-based mobile workloads/runtimes, while temporarily pinning to a specific .NET 11 preview SDK/feed to validate the new configuration.

Changes:

  • Remove Mono toolchain workload manifest dependency/version plumbing from eng/* and xaprepare.
  • Remove Mono-runtime test lanes (and MAUI integration test stages) from build-tools Azure Pipelines templates.
  • Update restore inputs for validation (temporary): add general-testing feed and pin .NET 11 preview versions.
Show a summary per file
File Description
NuGet.config Adds the general-testing feed for temporary validation restores.
eng/Versions.props Moves to a pinned .NET 11 preview SDK version; removes Mono toolchain manifest version properties.
eng/Version.Details.xml Updates .NET dependency versions/SHA; removes Mono toolchain manifest dependency entry.
build-tools/xaprepare/xaprepare/xaprepare.targets Stops generating replacements for removed Mono manifest properties.
build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs Removes Mono toolchain manifest copy logic; keeps Emscripten manifest copy.
build-tools/xaprepare/xaprepare/package-download.proj Removes Mono runtime pack downloads and Mono toolchain manifest downloads (now only Android CoreCLR runtime + Emscripten manifests).
build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs Removes Mono toolchain manifest package directory helpers.
build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in Removes default properties for Mono manifest/version variables.
build-tools/xaprepare/xaprepare/Application/KnownProperties.cs Removes Mono manifest/version property names.
build-tools/scripts/DotNet.targets Removes MAUI workload install step from the helper targets.
build-tools/create-packs/ConfigureLocalWorkload.targets Simplifies “ConfigureLocalWorkload” to only install the Android manifest (no dependency-install workaround).
build-tools/automation/yaml-templates/variables.yaml Removes the RunMAUITestJob variable.
build-tools/automation/yaml-templates/stage-package-tests.yaml Removes Mono-runtime APK instrumentation legs (Interpreter/NoAot/LLVM/etc).
build-tools/automation/azure-pipelines.yaml Removes MAUI test stage and dependency edges from the private pipeline definition.
build-tools/automation/azure-pipelines-public.yaml Removes MAUI test stage from the public pipeline definition.

Copilot's findings

  • Files reviewed: 15/15 changed files
  • Comments generated: 3

Comment thread build-tools/xaprepare/xaprepare/package-download.proj
Comment thread NuGet.config
Comment thread eng/Versions.props

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall, I'd take a different approach to this one:

  1. Introduce the error you have here: dotnet/sdk#54713 (just temporarily put it in this workload to test)
  2. See how red CI is
  3. Remove tests & iterate until green

The on-device tests you removed here looks right.

But we also have a lot of MSBuild tests that parameterize on MonoVM/CoreCLR/NativeAOT that would need to run for CoreCLR/NativeAOT only.

Then we can remove the error you have in step 1 (that can come from dotnet/sdk)

Comment on lines -416 to -421
# MAUI Tests Stage
- stage: maui_tests
displayName: MAUI Tests
dependsOn: mac_build
condition: and(succeeded(), ne(variables['SkipTestStages'], 'true'))
jobs:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This stage tests the MAUI pipeline with our product, doesn't seem like that should be deleted?

Because it is a main <-> net11.0 build, it does break sometimes until changes land in dotnet/maui/net11.0, so that's ok if this is the case here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Restored. Kept the MAUI Tests stage in both pipeline files. Agreed it is fine for it to break until the matching changes land in net11.0, so leaving it in place.

Comment thread eng/Version.Details.xml
Comment on lines -3 to 4
<Dependency Name="Microsoft.NET.Sdk" Version="11.0.100-preview.5.26268.112">
<Dependency Name="Microsoft.NET.Sdk" Version="11.0.100-preview.6.26310.106">
<Uri>https://github.com/dotnet/dotnet</Uri>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are we bumping .NET the same time?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Temporary validation pin to the .NET 11 test build so the repo can be exercised against the updated SDK. Not a permanent .NET bump.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That is what maestro is for; I wouldn't do this here.

See:

Comment thread build-tools/automation/yaml-templates/variables.yaml
Comment thread build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs
Comment thread build-tools/scripts/DotNet.targets
kotlarmilos and others added 5 commits June 15, 2026 18:13
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The MAUI integration stage installs the full maui workload, which pulls
mobile runtime workloads that are no longer produced for .NET 11. Remove
the stage from the public and internal pipelines and drop the now-unused
RunMAUITestJob variable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…able

Address review feedback: the native build and MAUI-on-local-build flow still
require the Mono runtime pack downloads and workload-install targets, so restore
package-download.proj, DotNet.targets, Step_InstallDotNetPreview, the xaprepare
property plumbing, the maui_tests stage, and the RunMAUITestJob variable. The PR
now changes only the Mono mobile instrumentation test legs in
stage-package-tests.yaml plus the temporary validation pins.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kotlarmilos kotlarmilos force-pushed the dev/update-sdk-mobile branch from bb45bf1 to a5a8047 Compare June 15, 2026 16:16
kotlarmilos and others added 4 commits June 15, 2026 20:03
Surface the unsupported Mono mobile runtime build error directly in the
workload to validate that no Mono mobile build paths remain in CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Validation now happens through the temporary Mono mobile runtime build
error in the workload, so the pinned SDK version and validation package
feed are no longer needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Gate the MonoVM runtime parametrization in the build tests so the Mono
variants are ignored on .NET 11 and later, where the Mono runtime is no
longer supported for Android. CoreCLR and NativeAOT variants are
unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Mono runtime is no longer supported for Android in .NET 11 and later.
Remove the Mono runtime variants from the build tests:

- Narrow the runtime parametrization ([Values], [TestCase], and the
  Enum.GetValues/TestCaseSource generators) to CoreCLR and NativeAOT.
- Delete the Mono-only test methods and their now-unused TestCaseSource
  data generators.

CoreCLR and NativeAOT coverage is unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kotlarmilos kotlarmilos force-pushed the dev/update-sdk-mobile branch from a16677b to d115ab9 Compare June 16, 2026 07:50
kotlarmilos and others added 2 commits June 16, 2026 11:58
The Mono mobile runtime is no longer supported for Android in .NET 11, so
building a project with UseMonoRuntime=true now errors with NETSDK1242. The
device integration test suite still enumerated AndroidRuntime.MonoVM through
[Values], Enum.GetValues, [Values(...)] and [TestCase(...)], causing those
emulator legs to fail. Drop the MonoVM variants and keep CoreCLR and NativeAOT,
matching the conversion already applied to Xamarin.Android.Build.Tests.

Mono-only tests (AOT profiler, interpreter, LLVM, AppDomain.UnhandledException,
and the MonoVM-only debugger break tests) are removed. Tests that merely pinned
MonoVM now use the default CoreCLR runtime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
LoggingPropsShouldCreateOverrideDirForRelease set debug.mono.log and asserted
methods.txt in the .__override__ directory, behavior that only the Mono runtime
produces. With the MonoVM pin dropped the test ran on CoreCLR, where methods.txt
is never emitted, so it failed. Remove the test; CoreCLR has no equivalent output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kotlarmilos

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines 814 to -824
@@ -815,60 +811,14 @@
}, Path.Combine (Root, builder.ProjectDirectory, "startup-logcat.log"), 60), $"Output did not contain {expectedLogcatOutput}!");
}

[Test]
public void SubscribeToAppDomainUnhandledException ([Values] AndroidRuntime runtime)
{
const bool isRelease = true;
if (IgnoreUnsupportedConfiguration (runtime, release: isRelease)) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we should delete this test, so it can be fixed for CoreCLR/NativeAOT.

Can it be [Values (AndroidRuntime.CoreCLR, AndroidRuntime.NativeAOT)] for now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems like this should pass on CoreCLR, enabling the test here for main:

Assert.Ignore ("https://github.com/dotnet/runtime/issues/88625");

var abisSanitized = supportedAbis.Replace (";", "").Replace ("-", "").Replace ("_", "");
var path = Path.Combine ("temp", string.Format ("BuildAotNdk AndÜmläüts_{0}_{1}_{2}", abisSanitized, enableLLVM, usesAssemblyBlobs));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if it's worth refactoring this test to run with CoreCLR release mode + NativeAOT release mode.

I bet a project named BuildAotNdk AndÜmläüts is problematic -- might not work.

};

[Test]
[TestCaseSource (nameof (SettingCombinationsSource))]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think SettingCombinationsSource can be removed

Comment on lines -573 to -589
// TODO: make it work on CoreCLR and NativeAOT
[Test]
[TestCaseSource(nameof (VersionCodeTestSource))]
public void VersionCodeTests (bool seperateApk, string abis, string versionCode, bool useLegacy, string versionCodePattern, string versionCodeProperties, bool shouldBuild, string expectedVersionCode)
{
var proj = new XamarinAndroidApplicationProject () {
IsRelease = true,
MinSdkVersion = "24",
SupportedOSPlatformVersion = "24.0",
};

// MonoVM-only test, for now (changing anything in the test data changes the codes, each case must be
// investigated and verified manually)
proj.SetRuntime (AndroidRuntime.MonoVM);
proj.SetProperty ("Foo", "1");
proj.SetProperty ("GenerateApplicationManifest", "false"); // Disable $(AndroidVersionCode) support
proj.SetProperty (proj.ReleaseProperties, KnownProperties.AndroidCreatePackagePerAbi, seperateApk);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should keep this test -- likely the only thing that validates AndroidCreatePackagePerAbi.

We can ignore if it doesn't pass, but a TODO comment to fix would be good.

kotlarmilos and others added 2 commits June 16, 2026 16:59
Remove the temporary _ErrorOnMonoMobileRuntime target now that CI
confirms no test legs build the Mono mobile runtime. The unsupported
configuration is enforced by the SDK.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore SubscribeToAppDomainUnhandledException for CoreCLR/NativeAOT
instead of deleting it. Remove the now-unused SettingCombinationsSource
in InvalidConfigTests. Restore VersionCodeTests to preserve
AndroidCreatePackagePerAbi coverage, ignored with a TODO until the test
data is reworked for CoreCLR/NativeAOT supported ABIs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants