In an application I have I register to the EventLog.EntryWritten event, and a .NET Threadpool thread is used to wait for the change event to happen. I think an exception is occurring in this .NET Threadpool thread, so I want to use try/catch to make sure, like this:
try {
eventLog.EntryWritten += new EntryWrittenEventHandler(EventLogMonitor);
}
catch (System.Componentmodel.Win32exception e)
{
// log error
}
I am just wondering if I have my try/ catch in the right place to monitor this thread for an exception?
EventLogMonitormight throw?