Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Commit 7212eb7

Browse files
authored
Don't use legacy pre-VS2017 logic if we successfully launched VS via vswhere (#114)
This second block needed to be guarded so that we don't accidentally launch two instances of Visual Studio.
1 parent ec096fe commit 7212eb7

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

Protobuild.Manager/IDEControl/VisualStudioIDEControl.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -415,18 +415,21 @@ private async Task<dynamic> LaunchVisualStudio(string modulePath, string moduleN
415415
}
416416
}
417417

418-
var versions = new[] {"14.0", "12.0", "11.0", "10.0"};
419-
foreach (var version in versions)
418+
if (!started)
420419
{
421-
var idePath = @"C:\Program Files (x86)\Microsoft Visual Studio " + version +
422-
@"\Common7\IDE\devenv.exe";
423-
if (File.Exists(idePath))
420+
var versions = new[] {"14.0", "12.0", "11.0", "10.0"};
421+
foreach (var version in versions)
424422
{
425-
Process.Start(
426-
idePath,
427-
"\"" + Path.Combine(modulePath, moduleName + "." + targetPlatform + ".sln") + "\"");
428-
started = true;
429-
break;
423+
var idePath = @"C:\Program Files (x86)\Microsoft Visual Studio " + version +
424+
@"\Common7\IDE\devenv.exe";
425+
if (File.Exists(idePath))
426+
{
427+
Process.Start(
428+
idePath,
429+
"\"" + Path.Combine(modulePath, moduleName + "." + targetPlatform + ".sln") + "\"");
430+
started = true;
431+
break;
432+
}
430433
}
431434
}
432435

0 commit comments

Comments
 (0)