Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two parsing defaults in the C#
SolutionParser/NuGetResolver, next to the existingEnableWindowsTargetingdefault. They're applied to MSBuildWorkspace and to restore-graph evaluation alike:AndroidUseManagedDesignTimeResourceGenerator=trueon non-Windows hosts. The Android SDK only defaults this on Windows, which is what Visual Studio relies on. Without it, design-time builds ofnet*-androidprojects on macOS/Linux validate the JDK and runaapt2. 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-androidon a .NET 10 SDK, say) otherwise fail evaluation and restore withNETSDK1202. 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
SolutionParserTests. The full:rewrite-csharp:csharpTestsuite passes.mod buildin 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 fromnet20tonet7.0plus 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.MSBuildEnableWorkloadResolver=false, which is handled separately.Related