473,507 Members | 2,405 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows service and EvenLog problem NET.2.0

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?

Apr 4 '07 #1
5 2410
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.

Apr 5 '07 #2

Found a thread that might be useful to you, check out the last post.
http://www.dotnet247.com/247referenc...30/153012.aspx

Apr 5 '07 #3
Thank you on your reply. I'll check that as soon as possible.

Apr 6 '07 #4

Latish Sehgal je napisao/la:
Found a thread that might be useful to you, check out the last post.
http://www.dotnet247.com/247referenc...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 :(

Apr 12 '07 #5
I can confirm that anything I have tried from thread mentioned above
doesn't help :(

Anyone had similar problem?

Apr 16 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
13060
by: Ashwin Kambli | last post by:
Hi, I am trying to write a Windows Service application using C#. I wrote a very trivial example (logs messages during Start and Stop events to the evenlog). I have no problem installing it (using...
9
7229
by: SP | last post by:
Hi All, I wrote a windows service which is supposed to stop after specified amount of time. I am calling OnStop() after specified time. OnStop() methods executed but I dont see the service...
1
3435
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
0
3905
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server -...
2
6878
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
6
8682
by: Joe | last post by:
C# .NET 2.0 I've got a Windows Service that works exactly as I expect it to. However, it does rely on a few Configuration settings. If the customer doesn't configure it correctly, the service...
4
4158
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
5
3270
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
1
2069
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi, I created a web service that I want to host in windows service. The problem is that if I host it as windows service it does not use the configuration file. I have to define the binding,...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.