Description for event id from source cannot be found
I got this error after creating an event source under the Application Log from the command line using "EventCreate".
This command creates a new key under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
If you look at the Key that's been created (e.g. SourceTest) there will be a string value calledEventMessageFile
, which for me was set to %SystemRoot%\System32\EventCreate.exe
.
Change this to c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll
Delete theCustomSource
and TypesSupported
values.
This should stop the "The description for Event ID...." message.
How about a real world solution.
If all you need is a "quick and dirty" way to write something to the event log without registering "custom sources" (requires admin rights), or providing "message files" (requires work and headache) just do this:
EventLog.WriteEntry(
".NET Runtime", //magic
"Your error message goes here!!",
EventLogEntryType.Warning,
1000); //magic
This way you'll be writing to an existing "Application" log without the annoying "The description for Event ID 0 cannot be found"
If you want the "magic" part explained I blogged about it here