1
Answer

Install window services

Rimshi B

Rimshi B

16y
3k
1
Hi I'm new in this Forums. So I dont know thios is is the right place to post my message or not. In my application I want to send mail on every weekend. So I created one window service. It builds successfully and I created service using installutil. But now when I'm trying to start my service, it automatically stops. and showing the error message like "The EService 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", can any one tell me how to resolve this.
Answers (1)
0
John Penn

John Penn

NA 3.1k 134.5k 16y
Are you using try/catch blocks to handle exceptions?  That's important in any application, but especially in a service because there's no UI to report errors with.  You should write Event Log entries for any caught exceptions, making sure to include any inner exceptions and their messages and stack traces.  This will be a big help in diagnosing any failures.

Also, try running the service under a different user account (double-click on service, go to "Log On" tab, change to "This Account" and specify an account that has the proper permissions to access whatever resources that the service needs to function).