Search code examples
windowswcfexceptionservice

Windows service for WCF Stops


I have a WCF application hosted as a windows service. This windows service triggers this WCF every 15 minutes. But when an exception occurs in this WCF the service is getting stopped.

I don't want this service to stop. I want to some how handle this exception and trigger this WCF after another 15 minutes.


Solution

  • You should handle exceptions in all your service operations in order to:

    • Return nice faults to the caller
    • Prevent the service from failing miserably

    Put a try/catch around every operation or use a custom behavior to handle all exceptions coming from your service