protected virtual Karma RunInternal(string outputDirectory) { var outputFile = Settings.GetOutputFile(outputDirectory); try { var processOptions = GetProcessOptions(); processOptions.Add("-o", outputFile); Logger.Info(processOptions.CommandLine); _process = new Process(processOptions); try { _process.StandardOutputRead += (o, e) => { Logger.Info(e.Line); }; _process.StandardErrorRead += (o, e) => { Logger.Info(e.Line); }; _process.Run(); } finally { _process = null; } var karma = Karma.Load(outputFile); return(karma); } catch (Exception ex) { Logger.Error(ex.Message); return(null); } finally { if (!Settings.LogToFile) { IO.File.Delete(outputFile); } } }