Windows service and EvenLog problem NET.2.0

G

Guest

I have created WS and Setup project. Created EventLog source and
custom log with EventLogInstaller.
Event log and source are created. WS is run as LocalSystem account so
the problem with write permissions for event log aren't problem
(installation is also executed with the same one).

Service is started with custom installation step and works fine.
But there are few issues that are raised doing all this:

1) i don't want to restart server/computer with service being
installed
2) but without that restart all my entries written to my custom event
log end up in Application log with error:
The description for Event ID ( 0 ) in Source ( XXXX ) cannot be found.
etc...

found suggestions to write registry value for:

EventMessageFile = C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\EventLogMessages.dll

but that also doesn't help.
In some weird cycle i got this things working but after deleting
source and custom log, restarting and installing WS again got the same
problem...?!?!

Anyone knows how to force OS to refresh event source list (found that
on MSDN :) ) or any other way how to work this out?
 
L

Latish Sehgal

Could you try giving a time gap between the creation of log and
writing to the log, just as a test (using Sleep()).
I remember reading somewhere that there is a time gap between creation
of log source and its availability. This might explain how you got
this to work in "some weird cycle". Perhaps you were debugging and
introduced a time gap at the right place.
 
P

Preky

Latish Sehgal je napisao/la:
Found a thread that might be useful to you, check out the last post.
http://www.dotnet247.com/247reference/msgs/30/153012.aspx

Unfortunatly it doesn't help :(

maybe the story is a bit different with windows services?! don't
know... the thing why i would like that eventlog would work like this
is rebooting server after service installation... i don't want to do
that... haven't tried it yet on win2k3 but hope it doesn't work like
this on that OS :(
 
P

Preky

I can confirm that anything I have tried from thread mentioned above
doesn't help :(

Anyone had similar problem?
 

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