static Logging() { s_P2PTraceSource = new P2PTraceSource(); if (s_P2PTraceSource.Switch.ShouldTrace(TraceEventType.Critical)) { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.ProcessExit += new EventHandler(ProcessExitEventHandler); //currentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionEventHandler); currentDomain.DomainUnload += new EventHandler(DomainUnloadEventHandler); } }