void Restart() { startTask = null; restartTokenSource.Cancel(); restartTokenSource = new CancellationTokenSource(); try { if (communicationManager != null) { communicationManager.StopServer(); communicationManager = null; } } catch (Exception ex) { LoggingService.LogError("TestPlatformCommunicationManager stop error.", ex); } try { if (vsTestConsoleExeProcess != null) { if (!vsTestConsoleExeProcess.IsCompleted) { vsTestConsoleExeProcess.Cancel(); } vsTestConsoleExeProcess = null; } } catch (Exception ex) { LoggingService.LogError("VSTest process dispose error.", ex); } }
public void Stop() { stopping = true; try { if (communicationManager != null) { communicationManager.StopServer(); communicationManager = null; } } catch (Exception ex) { LoggingService.LogError("TestPlatformCommunicationManager stop error.", ex); } try { if (dotNetProcess != null) { if (!dotNetProcess.HasExited) { dotNetProcess.Dispose(); } dotNetProcess = null; } } catch (Exception ex) { LoggingService.LogError("VSTest process dispose error.", ex); } }