コード例 #1
0
ファイル: RazorServer.cs プロジェクト: qanon1111/cli-1
 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;
 }
コード例 #2
0
 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);
     }
 }