private IVsTestConsoleWrapper PrepareVsTestConsole() { if (_vsTestConsole != null) { try { _vsTestConsole.EndSession(); } catch { /*Ignore exception. vsTestConsole has been disposed outside of our control*/ } _vsTestConsole = null; } var vstestLogPath = Path.Combine(_options.OutputPath, "logs", "vstest-log.txt"); _fileSystem.Directory.CreateDirectory(Path.GetDirectoryName(vstestLogPath)); _logger.LogDebug("Logging vstest output to: {0}", vstestLogPath); return(new VsTestConsoleWrapper(_vsTestHelper.GetCurrentPlatformVsTestToolPath(), new ConsoleParameters { TraceLevel = DetermineTraceLevel(), LogFilePath = vstestLogPath })); }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { _vsTestConsole.EndSession(); } disposedValue = true; } }
private void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _vsTestConsole.EndSession(); if (_ownHelper) { _vsTestHelper.Cleanup(); } } _disposedValue = true; } }