public RazorServer( RazorPidFile pidFile, ICommandFactory commandFactory = null, IFileSystem fileSystem = null) { PidFile = pidFile ?? throw new ArgumentNullException(nameof(pidFile)); _commandFactory = commandFactory ?? new DotNetCommandFactory(alwaysRunOutOfProc: true); _fileSystem = fileSystem ?? FileSystemWrapper.Default; }
private RazorPidFile ReadRazorPidFile(FilePath path) { try { return(RazorPidFile.Read(path, _fileSystem)); } catch (Exception ex) when(ex is IOException || ex is UnauthorizedAccessException) { _reporter.WriteLine( string.Format( LocalizableStrings.FailedToReadPidFile, path.Value, ex.Message).Yellow()); return(null); } }