N/APosted on - 06/24/2011
I am facing a very unique issue, where a Windows service is getting stopped immediately after starting again and again.
On looking into application event log, I have found several messages like ".NET SqlClient Data Provider failed to initialize properly (0xc0000142)."
However the same service is running fine on its backup server, which suggests that the database server on which it depends is free from any issue. Has anyone faced the similar issue and can provide me some possible causes of this behavior?
Thanks a lot.
Window service getting stopped continuously
Windows service getting stopped continuously is a complex problem. If you are not running any threads on start method to make your work, so an exception can appear to your on start method. By exception thrown windows event log will appear and event log is good for amu case start.
If you want to look on start method you will find it like this on start method,
protected override void OnStart(string args)
( // Comment to debug
// initial setup and initialization
// leave a thread to do work
_thread = new Thread(new MyClass().MyMethod)
// close this method to indicate the service has started)