Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6066611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:31:09+00:00 2026-05-23T09:31:09+00:00

I have a windows service run as a server. However, the server sometime stops

  • 0

I have a windows service run as a server. However, the server sometime stops immediately by an error which is un-handled. Please help me how to handle global exception. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:31:10+00:00Added an answer on May 23, 2026 at 9:31 am

    It sounds to me like you’re trying to solve the problem the wrong way around…

    When your program (or service) crashes because of an unhandled error, the solution is not to figure out where and how to "handle" all unhandled errors so that you can ignore them and continue execution. I’ve hashed out that view more clearly in this answer, but the short version is that when you encounter an unhandled exception, the correct thing to do is to crash. As quoted in the original answer:

    The fact that an unhandled exception occurred means that the server was in an unexpected state. By catching the exception and saying, "Don’t worry, it’s all good," you end up leaving a corrupted server running.

    [ . . . ]

    Catching all exceptions and letting the process continue running assumes that a server can recover from an unexpected failure. But this is absurd. You already know that the server is unrecoverably toast: It crashed!

    Much better is to let the server crash so that the crash dump can be captured at the point of the failure. Now you have a fighting chance of figuring out what’s going on.

    So in fact, the real solution involves figuring out the root cause of the unhandled exception and modifying your code to prevent that error from occurring in the first place.

    There’s no way that we can help you to do that unless you post the exact exception message that you’re getting, and preferably a full stack trace. But you definitely want to preserve the debugging information that you’re getting, rather than come up with a way to ignore it entirely—that’s the only way to actually solve the problem.

    If you still insist on ignoring all well-meaning advice to the contrary, you’ll find the "stick your head in the sand and ignore it" approach detailed here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows service, written in c# and I need to run a
I have written a Windows service that allows me to remotely run and stop
I have c# that will run in a windows service. I'm trying to use
I have a windows service that runs various system monitoring operations. However, when running
I have a Windows Service written in Delphi which runs a number of programs.
I have a WSE 3.0 based web service running in Windows Server 2003 under
I have a WCF server that I can run as a service or as
I have Sphinx running as a Service on Windows Server 2003 I also have
I have a dedicated Windows 2008 server with several websites and 1 windows service
Can you install and run your own windows services on ec2? Does it have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.