I am at designing phase and just converted from console to service. I want to know when out of memory exception happens in console it crashes out, but in case of window service seems like it is handled by service controller base class, and service still shows in running state.
So my question is:
How to make service stop?
I know if somehow I can catch the exception before service base class, it should be possible, but not sure.
Can someone provide the snippet? Also is it good practice to make service stop if some global unhandled exception occurs?