When developing a .Net application and trying to write to the eventlog, the actual message in the event log might contain:
The description for event id 0 cannot be found
This is usually due to the registry key HKLM\SYSTEM\CurrentControlSet\services\eventlog\[myLog]\[mySource]\EventMessageFile not being correctly set or not set at all.
In my case, the application was running with insufficient permissions to write that value. Changing the key permissions to my username fixed that issue. Running the application with administrative privileges should also do the job. This is on a development computer, if that happens on production/user computers, this key should probably be created at installation.
Sample code to write to the event log
string sSource="Debugging"; string message="Test"; if (!System.Diagnostics.EventLog.SourceExists(sSource)) System.Diagnostics.EventLog.CreateEventSource(sSource, "MyLog"); System.Diagnostics.EventLog.WriteEntry(sSource, message, System.Diagnostics.EventLogEntryType.Warning);