windows service in c#
-
Oh! This is driving me X|. I have a windows service written in C# and .NET. All it has to do is write an xml document based on the information found in the system, for every 5 seconds. So I have a timer and a GetInfo function. This function is called by the Elapsed event of the timer (every 5 secs). And I have included everything in try...catch block. In my catch block, I catch any exception thrown and store in EventLog. I am getting a lot of problems. 1. The service is not starting. When I start it using the Services Manager, it will attempt to start and end up saying "Service could not be started in a timely fashion". 2. In some test machines it starts although, its not writing any xml nor any EventLog Exception entry. I checked my code thoroughly and is just working ducky in my development machine. Is there some security issue that I need to consider while running this service? (I am running the service as LocalSystem account). How would this affect accessing Eventlog or writing an xml doc...??? Any suggestions/.. omkamal
-
Oh! This is driving me X|. I have a windows service written in C# and .NET. All it has to do is write an xml document based on the information found in the system, for every 5 seconds. So I have a timer and a GetInfo function. This function is called by the Elapsed event of the timer (every 5 secs). And I have included everything in try...catch block. In my catch block, I catch any exception thrown and store in EventLog. I am getting a lot of problems. 1. The service is not starting. When I start it using the Services Manager, it will attempt to start and end up saying "Service could not be started in a timely fashion". 2. In some test machines it starts although, its not writing any xml nor any EventLog Exception entry. I checked my code thoroughly and is just working ducky in my development machine. Is there some security issue that I need to consider while running this service? (I am running the service as LocalSystem account). How would this affect accessing Eventlog or writing an xml doc...??? Any suggestions/.. omkamal
Hi omkamal: Well i am running thru the same scenerio my friend. I am logged in as Local Admin on my win 2000 prof box and installed a .net C# service as LocalSystem account. When I try to start the service it hangs on and gives me that standard error, that is, "Service could not be started in a timely fashion". What all things do u need to take care or what are the prerequisites for a successful service install and start up? I even tried creating a basic service and tried starting it but gave me the same stupid error message!! Thanks, Rakesh