1

I am New in C# I want to capture unhanded exception in Windows services. whey i try this window services crash i don't what's problem... any help will be appreciated.

3
  • 2
    How about showing us some code providing us with at least the most tiny bit of information about what you're doing? Commented Jun 1, 2012 at 11:32
  • check in eventviewere of windows this could help you why window service is crashed. and also pass some code snippts here this would help you to get answer quiker Commented Jun 1, 2012 at 11:39
  • if i never got any answer how can i approve answer.. Commented Jun 1, 2012 at 11:48

1 Answer 1

3

Try this

add this in Constructor

 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 

after Constructor

 void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { Exception ex =(Exception)e.ExceptionObject; .... } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.