Appended text in the message

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.
 
W

Wajih-ur-Rehman

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top