예제 #1
0
 public static Task StartAsync(this ISolutionProjectModel model, bool attachDebugger,
                               CancellationToken cancellationToken = default(CancellationToken))
 {
     return(Task.Run(async() =>
     {
         foreach (ProcessStartInfo processStartInfo in model.GetSolutionProjects().Select(project => project.GetExecutable()).Where(processStartInfo => processStartInfo != null))
         {
             Output.WriteLine($"Starting {processStartInfo.FileName}");
             var task = ScriptHelper.ExecuteScriptAsync(processStartInfo.FileName, processStartInfo.Arguments, ScriptExecutionSettings.NormalProcess, cancellationToken: cancellationToken);
             if (attachDebugger)
             {
                 var result = await task;
                 DebugHelper.AttachProcess(result.Process.Id);
             }
         }
     }, cancellationToken));
 }