protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await base.InitializeAsync(cancellationToken, progress).ConfigureAwait(true); await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); var shell = (IVsShell) await GetServiceAsync(typeof(SVsShell)).ConfigureAwait(true); _componentModel = (IComponentModel) await GetServiceAsync(typeof(SComponentModel)).ConfigureAwait(true); var menuCommandService = (OleMenuCommandService) await GetServiceAsync(typeof(IMenuCommandService)).ConfigureAwait(true); cancellationToken.ThrowIfCancellationRequested(); Assumes.Present(shell); Assumes.Present(_componentModel); Assumes.Present(menuCommandService); // Set both handlers to non-fatal Watson. Never fail-fast the VS process. // Any exception that is not recovered from shall be propagated. FaultReporter.InitializeFatalErrorHandlers(); FatalError.CopyHandlerTo(typeof(InteractiveHostFatalError).Assembly); // Explicitly set up FatalError handlers for the InteractiveWindowPackage. Action <Exception> fatalHandler = e => FaultReporter.ReportFault(e, VisualStudio.Telemetry.FaultSeverity.Critical, forceDump: false); Action <Exception> nonFatalHandler = e => FaultReporter.ReportFault(e, VisualStudio.Telemetry.FaultSeverity.General, forceDump: false); SetErrorHandlers(typeof(IInteractiveWindow).Assembly, fatalHandler, nonFatalHandler); SetErrorHandlers(typeof(IVsInteractiveWindow).Assembly, fatalHandler, nonFatalHandler); _interactiveWindowProvider = _componentModel.DefaultExportProvider.GetExportedValue <TVsInteractiveWindowProvider>(); InitializeMenuCommands(menuCommandService); }
public void InitializeTelemetrySession(TelemetrySession telemetrySession, bool logDelta) { Contract.ThrowIfFalse(CurrentSession is null); Logger.SetLogger(CreateLogger(telemetrySession, logDelta)); FaultReporter.RegisterTelemetrySesssion(telemetrySession); CurrentSession = telemetrySession; TelemetrySessionInitialized(); }
public void UnregisterUnexpectedExceptionLogger(TraceSource logger) => FaultReporter.UnregisterLogger(logger);
static VisualStudioWorkspace() { FaultReporter.InitializeFatalErrorHandlers(); }