"Elioth" <El****@discussions.microsoft.comwrote in message
news:19**********************************@microsof t.com...
Yes, I have a Function to write a log in the Event Log. In the function I
check if the Log exists, if not I create it. Below the code of the
Function.
Just a little tip here on the Eventlog creation, it should be done at the
service start-up one time only.
The creation of the Event Log should not be checked and/or try to create the
log every time WriteLog is called. Once the Event Log for an application is
created, it's there permanently, until it's deleted out of the registry
either manually or programmically.
What I didn't see was the EventLog.Source statement that ties the Service to
the log, in your code.
But the question is this. In installing the service with IntsallUtil and you
have code in the service to create the Eventlog on the fly/(while the
service is running), then how does the InstallUtil even know about this
Eventlog and is trying to do something with installing the log?
The install of the log doesn't work and the InstallUtil is rolling it back
off of the computer system.
Do you have a EventlogInstaller as part of the project.?
It looked to me in the InstallUtil logs that the service was installed, it
proceeded to install the Eventlog, it ran into a problem, and it rolled
everything back off of the computer system, including the service.
If you're telling the service to create the log, which it will take care of
doing everything it needs to create/establish the log, the .NET Framework is
doing it, then why is InstallUtil in trying to install the service is it
doing something to create the Eventlog?
The service was installed successfully, and then there was a problem with
the Eventlog being installed that it should not be trying to install,
because you're telling the service while it's running to create the Eventlog
if it's not there.