The EventLog.Source Property docs on MSDN state:
Create the new event source during the installation of your application. This allows time for the operating system to refresh its list of registered event sources and their configuration.
How long does 'allows time' mean? I've added new Log Sources for our application on a test server but I'm still getting "Tracing to LogSource 'Information' failed" errors.
By the way I'm using System.Diagnostics.EventLog.CreateEventSource
to create my sources; I see that the MSDN docs talk about this being "similar" to using the EventLogInstaller
but don't elaborate on the differences [sigh]. Does it matter?
if (!System.Diagnostics.EventLog.SourceExists(source))
{
System.Diagnostics.EventLog.CreateEventSource(source, "Application");
}