public void Stop(bool immediate) { if (immediate) { return; } try { _monitor.Event("Application Shutdown", null, new Dictionary <string, string> { { "Reason", HostingEnvironment.ShutdownReason.ToString() } }); } catch (Exception ex) { _monitor.Exception(ex, null); } }