提交 9f4af51e 编写于 作者: S Sam Harwell

Stay on the STA thread when launching instances of Visual Studio

This change ensures tests stay on the main thread, which has the COM message
filter installed that deals with certain IPC delays. DTE operations from
other threads are not able to gracefully recover from certain failure
conditions.
上级 b0ec0d50
......@@ -109,7 +109,7 @@ public async Task<VisualStudioInstanceContext> GetNewOrUsedInstanceAsync(Immutab
try
{
bool shouldStartNewInstance = ShouldStartNewInstance(requiredPackageIds);
await UpdateCurrentlyRunningInstanceAsync(requiredPackageIds, shouldStartNewInstance).ConfigureAwait(false);
await UpdateCurrentlyRunningInstanceAsync(requiredPackageIds, shouldStartNewInstance).ConfigureAwait(true);
return new VisualStudioInstanceContext(_currentlyRunningInstance, this);
}
......@@ -170,7 +170,7 @@ private async Task UpdateCurrentlyRunningInstanceAsync(ImmutableHashSet<string>
}
// We wait until the DTE instance is up before we're good
dte = await IntegrationHelper.WaitForNotNullAsync(() => IntegrationHelper.TryLocateDteForProcess(hostProcess)).ConfigureAwait(false);
dte = await IntegrationHelper.WaitForNotNullAsync(() => IntegrationHelper.TryLocateDteForProcess(hostProcess)).ConfigureAwait(true);
}
else
{
......@@ -184,7 +184,7 @@ private async Task UpdateCurrentlyRunningInstanceAsync(ImmutableHashSet<string>
Debug.Assert(_currentlyRunningInstance != null);
hostProcess = _currentlyRunningInstance.HostProcess;
dte = await IntegrationHelper.WaitForNotNullAsync(() => IntegrationHelper.TryLocateDteForProcess(hostProcess)).ConfigureAwait(false);
dte = await IntegrationHelper.WaitForNotNullAsync(() => IntegrationHelper.TryLocateDteForProcess(hostProcess)).ConfigureAwait(true);
supportedPackageIds = _currentlyRunningInstance.SupportedPackageIds;
installationPath = _currentlyRunningInstance.InstallationPath;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册