469,949 Members | 2,168 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

Windows Service Crashing

A windows service that I developed is crashing unexpectedly. All the
logging/ tracing that I implemented cannot seem to catch the crash. I am
using multiple threads in many different areas.

In the event log I am getting a 7034 error. "Service terminated
unexpectedly."

Here is the question?
What is the best way to implement a global exception handler so I can catch
what is going on?

Shawn
Mar 30 '06 #1
4 1556
As a general catch all you could use:
AppDomain.CurrentDomain.UnhandledException +=new
UnhandledExceptionEventHandler(CurrentDomain_Unhan dledException);

Althought not relevant to Services, for Windows apps I use this:
Application.ThreadException += new
ThreadExceptionEventHandler(OnThreadException);

But I only enable them in production builds.

Mar 31 '06 #2
Do you make calls to API Win32 from your service ?

Mar 31 '06 #3
Yes I do. Why do you ask?
Shawn

"olrt" <ol**@ifrance.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Do you make calls to API Win32 from your service ?

Mar 31 '06 #4
I ask because the first thing that comes to my mind
is that a call to Win32 with improper arguments is
more likely to cause a crash in your service.
Maybe you should narrow your investigations on
what is causing the crash to calls to Win32 and
try to "comment" them or replace them with calls
to .NET API...

Apr 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Mike | last post: by
2 posts views Thread by Razzie | last post: by
5 posts views Thread by Chakkaradeep | last post: by
23 posts views Thread by Adam Clauss | last post: by
9 posts views Thread by Karthikeyan.T.S | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.