Appended text in the message

  • Thread starter Thread starter Wajih-ur-Rehman
  • Start date Start date
W

Wajih-ur-Rehman

Hi,

I use the following way to write to the Windows Event Log from my C#
application.

EventLog eventLog = new EventLog();
eventLog.Source = "My Source";

eventLog.WriteEntry("Just a test:",EventLogEntryType.Error);

Initially i was using 1.0 framework with VS 2002. It wrote "Just a test" to
the event log. Now I updated to 1.1 framework and VS2003. Now it writes:

"The description for Event ID ( 0 ) in Source ( ServiceName ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. The following
information is part of the event. Just a test"

What can i do to suppress the additional information that is appended with
my message. I just want to display my own message. Thanx in advance.
 
Found the problem....actually my application in this registry hive:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\My
ApplicationName

was pointing to this path:

C:\WINNT\Microsoft.NET\Framework\v1.1.4322\EventLogMessages.dll

which i had removed from my system. I gave it the correct path of 1.1 and it
solved the problem.
 
Back
Top