Skip to content

C#: parse Android without a JDK and out-of-support workloads (NETSDK1202) - #9013

Open
macsux wants to merge 1 commit into
mainfrom
macsux/xcopy-workloads-linux-image
Open

macsux wants to merge 1 commit into
mainfrom
macsux/xcopy-workloads-linux-image

Conversation

@macsux

@macsux macsux commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Two parsing defaults in the C# SolutionParser / NuGetResolver, next to the existing EnableWindowsTargeting default. They're applied to MSBuildWorkspace and to restore-graph evaluation alike:

  • AndroidUseManagedDesignTimeResourceGenerator=true on non-Windows hosts. The Android SDK only defaults this on Windows, which is what Visual Studio relies on. Without it, design-time builds of net*-android projects on macOS/Linux validate the JDK and run aapt2. With JDK 25, for example, they fail (Building with JDK version 25.0.2 is not supported), and the project loads with no references.
  • CheckEolWorkloads=false. Projects on an out-of-support workload (net8.0-android on a .NET 10 SDK, say) otherwise fail evaluation and restore with NETSDK1202. These are the codebases most in need of an upgrade, and they have to parse first. As a side effect, restore-graph generation stops failing for whole solutions because of one such project.

An explicit environment variable still wins for both.

Why

This is part of giving the Linux mass-ingest image type attribution for mobile and older .NET code. The image change lays out the .NET workloads (including net6–net8 support merged into SDK 10) and prepopulates reference assemblies. Both defaults here are needed for those projects to load in a design-time build.

Verification

  • Unit tests for both defaults in SolutionParserTests. The full :rewrite-csharp:csharpTest suite passes.
  • End to end with mod build in the mass-ingest image (linux/amd64) on 21 repos and test projects. These include eShop, maui-samples, android-samples, macios-samples, a net8 MAUI app and a 43-project matrix from net20 to net7.0 plus mobile and WPF. Android, iOS, Mac Catalyst, macOS, tvOS and MAUI projects attribute. net8 mobile reference lists are identical to a real SDK 8 install, and net9/net10 results are identical to a macOS full workload install.
  • Not covered by this PR: workloads only load once the RPC server stops setting MSBuildEnableWorkloadResolver=false, which is handled separately.

Related

… without NETSDK1202

Design-time builds of net*-android projects on macOS and Linux validate the
JDK and run aapt2 unless AndroidUseManagedDesignTimeResourceGenerator is set,
which the Android SDK only defaults on Windows. With JDK 25 they fail and the
project loads with no references. Default it to true, as Visual Studio does.

Projects on an out-of-support workload (net8.0-android on a .NET 10 SDK, say)
fail evaluation and restore with NETSDK1202. Default CheckEolWorkloads to
false: those are the codebases most in need of an upgrade, and they have to
parse first. An explicit environment variable still wins for both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant