private static void CurrentDomain_ProcessExit(object sender, EventArgs e) { // CONSIDER: We get this quite late in the shutdown // We should try to find a way to identify Excel shutdown a lot earlier Logger.Initialization.Verbose("IntelliSenseServer ProcessExit Begin"); if (_isActive) { // Parachute in asap a call to prevent further XLPenHelper calls XlCall.ShutdownStarted(); Deactivate(); } Logger.Initialization.Verbose("IntelliSenseServer ProcessExit End"); }
static void CurrentDomain_ProcessExit(object sender, EventArgs e) { // CONSIDER: We get this quite late in the shutdown // We should try to find a way to identify Excel shutdown a lot earlier Logger.Initialization.Verbose("IntelliSenseServer ProcessExit Begin"); if (_isActive) { // Parachute in asap a call to prevent further XLPenHelper calls XlCall.ShutdownStarted(); // Don't try to clean up clean up on process exit - all our resources are in-process anyway // Leads to an error with the main thread SynchronizationContext, which might be shut down already. // In particular we don't have to call UnhookWinEvent: "If the client's thread ends, the system automatically calls this function." } Logger.Initialization.Verbose("IntelliSenseServer ProcessExit End"); }