Windows Service on Win2003 server

G

Guest

Hello,
I have created a windows service in C# that watches a folder, then moves
files place in it to another server. When I test this service on my local
machine it runs great. I have had it running for about 5 days now. I have
put in plenty of error coding just in case something goes wrong. My problem
is that I have tried to move it to a Windows 2003 server. It installs with
no problem. When I start the service it gives me a message that says:
"The FileWatcherSvc service on Local Computer started and then stopped.
Some services stop automatically if they have no work to do, for example, the
Performance Logs and Alerts service."

The user that I used to run the service as has full Admin rights.
Two other things the service has that might effect it are: emails errors to
me, and uses Windows Remoting to communicate with other apps.

I'm tired of looking and finding no help. So if you can help I would be
forever in your debt.

Michael
 
M

Michael Bray

Hello,
I have created a windows service in C# that watches a folder, then
moves
files place in it to another server. When I test this service on my
local machine it runs great. I have had it running for about 5 days
now. I have put in plenty of error coding just in case something goes
wrong. My problem is that I have tried to move it to a Windows 2003
server. It installs with no problem. When I start the service it
gives me a message that says: "The FileWatcherSvc service on Local
Computer started and then stopped. Some services stop automatically
if they have no work to do, for example, the Performance Logs and
Alerts service."


Have you tried attaching a remote debugger? Obviously, in order to do this
you will need to have some kind of delay mechanism built into the Main()
function - perhaps a 30 second delay to give you time to attach. You would
want to set a breakpoint after the delay, and also in the OnStart to see
what is happening. Alternatively, you could enable desktop integration and
have it put a MessageBox up (just for debugging purposes of course.)

-mdb
 
W

Willy Denoyette [MVP]

| Hello,
| I have created a windows service in C# that watches a folder, then moves
| files place in it to another server. When I test this service on my local
| machine it runs great. I have had it running for about 5 days now. I
have
| put in plenty of error coding just in case something goes wrong. My
problem
| is that I have tried to move it to a Windows 2003 server. It installs
with
| no problem. When I start the service it gives me a message that says:
| "The FileWatcherSvc service on Local Computer started and then stopped.
| Some services stop automatically if they have no work to do, for example,
the
| Performance Logs and Alerts service."
|
| The user that I used to run the service as has full Admin rights.
| Two other things the service has that might effect it are: emails errors
to
| me, and uses Windows Remoting to communicate with other apps.
|
| I'm tired of looking and finding no help. So if you can help I would be
| forever in your debt.
|
| Michael

Adding to what Michael said, my guess is that you are running into a
security issue resulting in an unhandled exception, this will terminate the
service thread (the one started from within OnStart), the result is a
premature service termination.

Willy.
 
G

Guest

There is also an issue with Win2003 RTM and services installed to run as
local system where an ACL can be corrupted and things dont work anymore. Try
uninstalling the service and reinstalling it to run as a local/domain user
account (it needs to be a fresh install, not just a change to the config). If
this works then there is a service pack / hotfix for it in the KB (cant find
the KB id at the mo), if not then try the remote debugging route.

HTH

Ciaran O'Donnell
 

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