public static DotNetExecutionCommand ConvertCommand(
            DotNetCoreExecutionCommand command)
        {
            command.Initialize();

            return(new DotNetExecutionCommand(
                       command.GetCommand(),
                       command.GetArguments(),
                       command.WorkingDirectory
                       )
            {
                UserAssemblyPaths = new List <string> ()
            });
        }
Exemplo n.º 2
0
        protected async override Task OnExecute(ProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
        {
            var config = GetConfiguration(configuration) as DotNetProjectConfiguration;

            DotNetCoreExecutionCommand executionCommand = CreateDotNetCoreExecutionCommand(configuration, config);

            if (context.ExecutionTarget != null)
            {
                executionCommand.Target = context.ExecutionTarget;
            }

            executionCommand.Initialize();

            if (CanDebug(executionCommand, context))
            {
                await base.OnExecute(monitor, context, configuration);

                return;
            }

            monitor.Log.WriteLine(GettextCatalog.GetString("Running {0} ...", Name));

            OperationConsole console = CreateConsole(config, context, monitor);

            try {
                try {
                    ProcessAsyncOperation asyncOp = Execute(executionCommand, console);
                    await asyncOp.Task;

                    monitor.Log.WriteLine(GettextCatalog.GetString("The application exited with code: {0}", asyncOp.ExitCode));
                } finally {
                    console.Dispose();
                }
            } catch (Exception ex) {
                LoggingService.LogError(string.Format("Cannot execute \"{0}\"", Name), ex);
                monitor.ReportError(GettextCatalog.GetString("Cannot execute \"{0}\"", Name), ex);
            }
        }
Exemplo n.º 3
0
 bool CanDebug(DotNetCoreExecutionCommand command, ExecutionContext context)
 {
     return(command.IsExecutable ||
            (command.IsAssembly && IsDebug(context) && VSCodeDebuggerEngine.Exists()));
 }