Skip to content

Commit f6bc018

Browse files
committed
Update to continue supporting fallback vswhere arg
And add brackets the ensure only the specified version is found
1 parent 84ce771 commit f6bc018

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Assets/MixedRealityToolkit/Utilities/BuildAndDeploy/UwpAppxBuildTools.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,12 @@ private static async Task<string> FindMsBuildPathAsync()
177177
string version = "";
178178
if (string.IsNullOrWhiteSpace(EditorUserBuildSettings.wsaUWPVisualStudioVersion))
179179
{
180-
version = "-latest";
180+
version = " -latest";
181181
}
182182
else
183183
{
184-
version = $"-version {EditorUserBuildSettings.wsaUWPVisualStudioVersion}";
184+
// Add version number with brackets to find only the specified version
185+
version = $" -version [{EditorUserBuildSettings.wsaUWPVisualStudioVersion}]";
185186
}
186187

187188
var result = await new Process().StartProcessAsync(
@@ -192,7 +193,7 @@ private static async Task<string> FindMsBuildPathAsync()
192193
UseShellExecute = false,
193194
RedirectStandardOutput = true,
194195
RedirectStandardError = true,
195-
Arguments = string.Format(findOption.arguments, version),
196+
Arguments = $"{findOption.arguments}{version}",
196197
WorkingDirectory = @"C:\Program Files (x86)\Microsoft Visual Studio\Installer"
197198
});
198199

@@ -633,7 +634,7 @@ public VSWhereFindOption(string args, string suffix)
633634
{
634635
// This find option corresponds to the version of vswhere that ships with VS2019.
635636
new VSWhereFindOption(
636-
@"/C vswhere -all -products * {0} -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe",
637+
@"/C vswhere -all -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe",
637638
""),
638639
// This find option corresponds to the version of vswhere that ships with VS2017 - this doesn't have
639640
// support for the -find command switch.

0 commit comments

Comments
 (0)