コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }