fix: Fix VS workload detection logic for iOS and Android workloads on modern VS #3022
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.
PR Details
Updates the Visual Studio workload detection logic for Android and iOS to properly detect the modern post-Xamarin workloads. Also fixes a logical error in IsVSComponentAvailableAnyVersion when multiple versions of Visual Studio are installed, regardless of what order the components are defined in the dictionary: previously, if the first version check fails, it would return false, even if later checks would succeed. Now it checks all entries and returns true if any check succeeds.
Related Issue
#3020
This PR is a partial fix for the above issue. There are still references to Xamarin in a "test" project template, and there are still rendering/fullscreen issues when run in the android emulator. These are out of scope for this PR, which fixes the new project creation process to properly detect the .net for mobile workloads in modern versions of Visual Studio, where Xamarin is no longer installable.
Types of changes
Checklist
NOTE: I have not been able to get the project tests to pass, before or after this change. This change does not cause more tests to fail on my machine compared to the master branch. I was also not able to find any tests for this specific part of the code that was changed - understandable given that to fully test this logic, you'd have to run the tests on multiple dev environments with different versions of Visual Studio installed with or without workloads installed. I tested the editor after this change with Visual Studio 2026 installed, with the .net for mobile workloads installed, ran and created a new project with various templates, checking the iOS and Android platforms when creating the project, and verifying the proper android/iOS TFMs are added to the target frameworks for the main "Game" project (some templates use ".Game" suffix, others don't).
NOTE 2: This is my first PR for the Stride project. Apologies if I missed something in the contribution workflow. I did read the docs here: https://doc.stride3d.net/latest/en/contributors/contribution-workflow/index.html