public static int Main(string[] args) { var tracerMock = new Mock <ITracer>(); IChildProcessManager childProcessManager = new ChildProcessManager(tracerMock.Object); return(childProcessManager.RunAndListenToParentAsync <TestChildProcessInput, TestChildProcessOutput>(args, MainTask, ConvertExceptionToExitCode, false).GetAwaiter().GetResult()); }
public static void Main(string[] args) { var tracerMock = new Mock <ITracer>(); IChildProcessManager childProcessManager = new ChildProcessManager(tracerMock.Object); childProcessManager.RunAndListenToParentAsync <TestChildProcessInput, TestChildProcessOutput>(args, MainTask, false).Wait(); }
/// <summary> /// Invoked when the debug host is loading. By default this launches the remote service client. /// </summary> protected virtual void DebugHostLoading() { // Start remote console session string serviceClientName = ServiceClientName; if (!string.IsNullOrWhiteSpace(serviceClientName)) { m_processManager = new ChildProcessManager(); m_processManager.AddProcess(Process.Start(FilePath.GetAbsolutePath(serviceClientName))); } }
/// <summary> /// Creates a new instance of the <see cref="ProcessLauncher"/> class. /// </summary> public ProcessLauncher() { m_process = new Process(); m_messageLevelMap = new Dictionary <string, MessageLevel>(StringComparer.OrdinalIgnoreCase); m_processUtilizationCalculator = new ProcessUtilizationCalculator(); // In Windows environments, make sure child processes can be terminated if parent is terminated - even if termination is not graceful if (!Common.IsPosixEnvironment) { m_childProcessManager = new ChildProcessManager(); } }
public MainViewModel() { _telemetryClient = new TelemetryClient { InstrumentationKey = ApplicationInsightsInstrumentationKey }; _telemetryClient.Context.Component.Version = _currentVersion.ToString(); #if DEBUG _telemetryClient.Context.Properties["DEBUG"] = "1"; #endif if (SendTelemetry) { _telemetryClient.TrackEvent(TelemetryEventNames.Start); } Application.Current.DispatcherUnhandledException += (o, e) => OnUnhandledDispatcherException(e); AppDomain.CurrentDomain.UnhandledException += (o, e) => OnUnhandledException((Exception)e.ExceptionObject, flushSync: true); TaskScheduler.UnobservedTaskException += (o, e) => OnUnhandledException(e.Exception); NuGet = new NuGetViewModel(); NuGetConfiguration = new NuGetConfiguration(NuGet.GlobalPackageFolder, NuGetPathVariableName); RoslynHost = new RoslynHost(NuGetConfiguration, new[] { Assembly.Load("RoslynPad.RoslynEditor") }); ChildProcessManager = new ChildProcessManager(); NewDocumentCommand = new DelegateCommand((Action)CreateNewDocument); CloseCurrentDocumentCommand = new DelegateCommand(CloseCurrentDocument); ClearErrorCommand = new DelegateCommand(() => LastError = null); ReportProblemCommand = new DelegateCommand((Action)ReportProblem); _editorFontSize = Properties.Settings.Default.EditorFontSize; DocumentRoot = CreateDocumentRoot(); Documents = DocumentRoot.Children; OpenDocuments = new ObservableCollection <OpenDocumentViewModel>(LoadAutoSaves(DocumentRoot.Path)); OpenDocuments.CollectionChanged += (sender, args) => OnPropertyChanged(nameof(HasNoOpenDocuments)); if (HasNoOpenDocuments) { CreateNewDocument(); } else { CurrentOpenDocument = OpenDocuments[0]; } if (HasCachedUpdate()) { HasUpdate = true; } else { Task.Run(CheckForUpdates); } }