Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Service terminated unexpectedly

I have a windows service which has a number of threads that do some work. All has been going well in testing, until once, where I saw "windows service terminated unexpectedly" in the event viewer.

How do I go about trying to debug where this is happening? I have exceptions being caught under normal circumstances but not in this case.

I do not know where to start.

JD.

like image 899
JD. Avatar asked Jul 31 '09 10:07

JD.


2 Answers

Put a call to System.Diagnostics.Debugger.Break() in your OnStart() callback. When your service starts up, you'll be prompted to start the Visual Studio debugger. Once the debugger opens, you can debug from there.

like image 91
Matt Davis Avatar answered Oct 22 '22 02:10

Matt Davis


here you can find How to: Debug Windows Service Applications

like image 36
Arsen Mkrtchyan Avatar answered Oct 22 '22 02:10

Arsen Mkrtchyan