From 4db8598f8c3542b04782b856f7de4457144a7a8e Mon Sep 17 00:00:00 2001 From: Jeremy Bell Date: Sun, 28 Dec 2025 02:15:58 -0500 Subject: [PATCH 1/2] Updates the Visual Studio workload 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. --- sources/engine/Stride.Assets/StrideConfig.cs | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sources/engine/Stride.Assets/StrideConfig.cs b/sources/engine/Stride.Assets/StrideConfig.cs index 3dab2730a6..08655dc4ad 100644 --- a/sources/engine/Stride.Assets/StrideConfig.cs +++ b/sources/engine/Stride.Assets/StrideConfig.cs @@ -23,15 +23,15 @@ public sealed class StrideConfig private static readonly Version VS2015Version = new Version(14, 0); private static readonly Version VSAnyVersion = new Version(int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue); - internal static readonly Dictionary XamariniOSComponents = new Dictionary + internal static readonly Dictionary DotNetForiOSComponents = new Dictionary { - { VSAnyVersion, @"Component.Xamarin" }, + { VSAnyVersion, @"Microsoft.VisualStudio.Workload.NetCrossPlat" }, { VS2015Version, @"MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets" } }; - internal static readonly Dictionary XamarinAndroidComponents = new Dictionary + internal static readonly Dictionary DotNetForAndroidComponents = new Dictionary { - { VSAnyVersion, @"Component.Xamarin" }, + { VSAnyVersion, @"Microsoft.VisualStudio.Workload.NetCrossPlat" }, { VS2015Version, @"MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets" } }; @@ -143,7 +143,7 @@ internal static void RegisterSolutionPlatforms() Name = PlatformType.Android.ToString(), Type = PlatformType.Android, TargetFramework = "net10.0-android", - IsAvailable = IsVSComponentAvailableAnyVersion(XamarinAndroidComponents) + IsAvailable = IsVSComponentAvailableAnyVersion(DotNetForAndroidComponents) }; androidPlatform.DefineConstants.Add("STRIDE_PLATFORM_MONO_MOBILE"); androidPlatform.DefineConstants.Add("STRIDE_PLATFORM_ANDROID"); @@ -170,7 +170,7 @@ internal static void RegisterSolutionPlatforms() SolutionName = "iPhone", // For iOS, we need to use iPhone as a solution name Type = PlatformType.iOS, TargetFramework = "net10.0-ios", - IsAvailable = IsVSComponentAvailableAnyVersion(XamariniOSComponents) + IsAvailable = IsVSComponentAvailableAnyVersion(DotNetForiOSComponents) }; iphonePlatform.PlatformsPart.Add(new SolutionPlatformPart("iPhoneSimulator")); iphonePlatform.DefineConstants.Add("STRIDE_PLATFORM_MONO_MOBILE"); @@ -240,12 +240,19 @@ internal static bool IsVSComponentAvailableAnyVersion(IDictionary ideInfo.PackageVersions.ContainsKey(pair.Value) - ); + )) + { + return true; + } } return false; } From 1cea1b856721b23bcf113fb4387bedd92843d192 Mon Sep 17 00:00:00 2001 From: Jeremy Bell Date: Mon, 5 Jan 2026 16:51:43 -0500 Subject: [PATCH 2/2] Small formatting change from PR feedback. --- sources/engine/Stride.Assets/StrideConfig.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/engine/Stride.Assets/StrideConfig.cs b/sources/engine/Stride.Assets/StrideConfig.cs index 08655dc4ad..c7b4e53d4c 100644 --- a/sources/engine/Stride.Assets/StrideConfig.cs +++ b/sources/engine/Stride.Assets/StrideConfig.cs @@ -240,14 +240,14 @@ internal static bool IsVSComponentAvailableAnyVersion(IDictionary ideInfo.PackageVersions.ContainsKey(pair.Value) )) {