Monday, November 12, 2007

Creating Event Log EventID Values Using C# and .Net 2.0

As all good developers do, I try to log my errors.  However, on some machines I can access the event log ("Application" log in this case) and use EventID of 1000 or 0 or other values, however, it is not consistant what is available between Windows 2000, Windows XP, Windows Server 2003.

So I have the following in my Event Log more often that I would like:

The description for Event ID ( 0 ) in Source ( Application Error ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event:  ...

http://www.codeproject.com/dotnet/evtvwr.asp
http://blog.sbsfaq.com/Lists/Posts/Post.aspx?List=269e4081%2Dac58%2D42a6%2D9a54%2D383a6a3fb0d8&ID=49