diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/StartPage_InProc.cs b/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/StartPage_InProc.cs index 8f926d6d266b193a674b7bb9c7eded1f368bdf2f..72cab2c1bf61c4c2e881e7142fb4636130027824 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/StartPage_InProc.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/InProcess/StartPage_InProc.cs @@ -2,15 +2,20 @@ using System; using Microsoft.VisualStudio.Shell.Interop; +using vsStartUp = EnvDTE.vsStartUp; namespace Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess { internal class StartPage_InProc : InProcComponent { // Values come from Tools -> Options -> Environment -> Startup -> At startup - private const int ShowEmptyEnvironment = 4; + private const int ShowEmptyEnvironment = (int)vsStartUp.vsStartUpEmptyEnvironment; private const int ShowStartPage = 5; + // These values apply to Visual Studio 2019 + private const int VS2019ShowStartWindow = 13; + private const int VS2019ShowEmptyEnvironment = 10; + public static StartPage_InProc Create() => new StartPage_InProc(); @@ -19,7 +24,14 @@ public bool IsEnabled() return InvokeOnUIThread(() => { var property = GetProperty(); - return (int)property.Value == ShowStartPage; + if (new Version(property.DTE.Version).Major == 16) + { + return (int)property.Value == VS2019ShowStartWindow; + } + else + { + return (int)property.Value == ShowStartPage; + } }); } @@ -28,7 +40,14 @@ public void SetEnabled(bool enabled) InvokeOnUIThread(() => { var property = GetProperty(); - property.Value = enabled ? ShowStartPage : ShowEmptyEnvironment; + if (new Version(property.DTE.Version).Major == 16) + { + property.Value = enabled ? VS2019ShowStartWindow : VS2019ShowEmptyEnvironment; + } + else + { + property.Value = enabled ? ShowStartPage : ShowEmptyEnvironment; + } }); } diff --git a/src/VisualStudio/IntegrationTest/TestUtilities/VisualStudioInstanceFactory.cs b/src/VisualStudio/IntegrationTest/TestUtilities/VisualStudioInstanceFactory.cs index 9b7f4cbf78b5c498b938c1eb71ddb1cbd4f3d8a1..8986df7de49578953130bd69a61bd0bf562e97bd 100644 --- a/src/VisualStudio/IntegrationTest/TestUtilities/VisualStudioInstanceFactory.cs +++ b/src/VisualStudio/IntegrationTest/TestUtilities/VisualStudioInstanceFactory.cs @@ -163,7 +163,9 @@ private async Task UpdateCurrentlyRunningInstanceAsync(ImmutableHashSet supportedPackageIds = ImmutableHashSet.CreateRange(instance.GetPackages().Select((supportedPackage) => supportedPackage.GetId())); installationPath = instance.GetInstallationPath(); - hostProcess = StartNewVisualStudioProcess(installationPath); + var instanceVersion = instance.GetInstallationVersion(); + var majorVersion = int.Parse(instanceVersion.Substring(0, instanceVersion.IndexOf('.'))); + hostProcess = StartNewVisualStudioProcess(installationPath, majorVersion); var procDumpInfo = ProcDumpInfo.ReadFromEnvironment(); if (procDumpInfo != null) @@ -248,8 +250,6 @@ private static ISetupInstance LocateVisualStudioInstance(ImmutableHashSet