Windows Forms Event Log

Posted by blu on Stack Overflow See other posts from Stack Overflow or by blu
Published on 2010-04-03T01:14:01Z Indexed on 2010/04/03 1:23 UTC
Read the original article Hit count: 425

Filed under:
|
|

I am writing to the event log from my Windows Forms application running on Windows 7 and am getting this message in the event log:

The description for Event ID X from source Application cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Exception Details

the message resource is present but the message is not found in the string/message table

My logging code is:

public void Log(Exception exc)
{
    EventLog.WriteEntry(
        "Application", 
        exc.ToString(), 
        EventLogEntryType.Error, 
        100);
}

My logging on Windows Forms is usually to a DB, but in this case decided to use the event log. I usually use the event log in ASP.NET applications, but those are on XP Pro locally and Windows Server 2003 on the web boxes.

Is this a Windows 7 thing or a Windows Forms thing, and what should I do to fix this? Thanks.

© Stack Overflow or respective owner

Related posts about windows-forms

Related posts about c#