The service could not be started. The service did not report an error.
I encounter this error whenever I install a windows service project in the command line. It's true that there's an error in my code, but how can I find that error with this kind of error message?
There is an exception in your service's OnStart() method, add
try{...}
catch(Exception ex)
{
//write to file ex.ToString();
}
and log your exception to file
Add error handling block (catching UnhandledException or just try/catch block around suspected code) and log it (I use either Trace or Debug - you can view that messages with DebugView).
In order to give idea to Service Manager that there is error (just to help user) you can:
service.ExitCode = 1064; //ERROR_EXCEPTION_IN_SERVICE - just example
Where "service" is your Service's object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With