EventLog Source still created after deleting all references to it

N

Next

Hello all,

I have a windows service that was suppose to write some events into its own
EventLog.

I created the EventLog using the component on VS 2003 toolbar
Added an installer for it.
Set all the appropriate properties to assign the new Source to a new log.

For some reason installutil.exe created the source in the correct log. But
then tried to create the same source in the Application log.

This of course caused the installation to rollback because the source
already existed.

I couldn't figure out what was going on, so I deleted ALL of my eventlog
instances and anything else that had to do with the EventLog.

InstallUtil is now creating my new source in the Application log. I have
searched, deleted, rebuilt,...but there are no references to any EventLog or
my new source.

Can anybody shed some light on where any other EventLog code could be?

Aaron
 
G

Guest

Something very similar is happening to me. I created a source and used the
application log for logging errors. I decided to write a custom log for
these errors and it doesn't work when I give it the source name as it use to
be. I have deleted all references that I could find related to the source
name, but everytime I recreate it I can only successfully log to the
application log and not my custom log.

I have deleted the source using EventLog.DeleteEventSource(SOURCENAME) and
it appears to be deleted until I try to recreate it and write to my custom
log using that sourcename. I have deleted the refrences in the registry as
well and same exact thing happens. It seems that even though the source is
deleted it has some reference to the old log that it was associated with.
Any advice on this issue?

Here is ex code I am using:
if(!EventLog.SourceExists(source))
{
EventLog.CreateEventSource(source, "TTLog");
}

// Create an EventLog instance and assign its source.
EventLog myLog = new EventLog();
myLog.Source = source;

// Write an informational entry to the event log.
myLog.WriteEntry(errorMessage, EventLogEntryType.Error);

Whenever I do this, it my error is logged in the application log as:
The description for Event ID ( 0 ) in Source ( SOURCENAME) 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: ERROR MESSAGE
APPEARS HERE
 
G

Guest

I rebooted my box and that clears the current control set. That seemed to
fix the problem that I was having.
 

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