Question : The description for Event ID ( 0 ) in Source ( .... ) cannot be found

I am trying to write information to the Event Log from a Web Service.

I am able to create a "CroInternalWebServices" category in the Event Viewer, and I am able to write to it using the code that I have listed.

I can write to the Event Log (screen shot attached).  However, every message is preceded with the text:

The description for Event ID ( 0 ) in Source ( CroInternalWebServices ) 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:  {then my message is printed out here....}


I would like to be stop that error message from appearing in every one of my event messages.  How do I do this?

I have tried many options listed in other similar threads and had a look at other forums but none seem to solve this exact problem.

I am using v/s 2005 professional, and it's on Win XP Pro.  I added the ASPNET user to Administrators but this did not work.  Whether I use an Event ID of 0, or 1000, I get the same error.  The Web Services will eventually be deployed on Win Server 2003.


Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
[WebMethod]    
    public void AAA_WriteToEventLog(string message)
    {
 
        string source = "CroInternalWebServices"; 
        string logType = "Application"; 
        string machineName = "."; 
 
        if (!System.Diagnostics.EventLog.SourceExists(source, machineName))
        {
            System.Diagnostics.EventLog.CreateEventSource(new EventSourceCreationData(source, logType));
        }
 
        System.Diagnostics.EventLog eLog = new EventLog(logType, machineName, source);
        
        eLog.WriteEntry(message, EventLogEntryType.Information);
 
    }

Answer : The description for Event ID ( 0 ) in Source ( .... ) cannot be found

Update: we couldn't get this working so we wrote our own logging methods to write to different log files.
Thanks for help.
Random Solutions  
 
programming4us programming4us