async Task <(bool success, string message)> LaunchCatalyst(LaunchData launchOptions, int port) { var projectDir = Path.GetDirectoryName(launchOptions.Project); if (!Directory.Exists(projectDir)) { projectDir = launchOptions.WorkspaceDirectory; } Environment.SetEnvironmentVariable("__XAMARIN_DEBUG_HOSTS__", "127.0.0.1"); Environment.SetEnvironmentVariable("__XAMARIN_DEBUG_PORT__", port.ToString()); var args = new string[] { "build", //"--no-restore", "-f", launchOptions.ProjectTargetFramework, $"\"{launchOptions.Project}\"", "-t:Run" //, //"-verbosity:diag" }; SendConsoleEvent("Executing: dotnet " + string.Join(" ", args)); return(await Task.Run(() => DotnetRunner.Run( d => SendConsoleEvent(d), projectDir, args))); }
public static (bool Success, string Output) Run(Action <string> consoleOutputHandler, string workingDir, params string[] args) { var dr = new DotnetRunner(string.Join(" ", args), workingDir, CancellationToken.None, consoleOutputHandler); var r = dr.WaitForExit(); var t = string.Join(Environment.NewLine, r.StandardError.Concat(r.StandardOutput)); return(!r.StandardError.Any(), t); }