none
Ask a question about how to capture StackOverFlow or OutofMemory exceptions RRS feed

  • Question

  • Hi guys,

    Need your kind help. 

    I need to make the logging functionality for any unhandled exceptions in one WCF service which is hosted in IIS. .NET version is V4.6.1.

    When I implemented the interface IErrorHandler, it doesn't capture the unhandled StackOverFlow or OutofMemory exceptions. 

    Do you know whether there is any way to capture for logging?

    Because it is the production, Adplus should be not an option. 

    Any idea?

    Thanks always,



    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Riquel I'm Tuesday, June 27, 2017 1:36 PM
    Tuesday, June 27, 2017 1:36 PM

Answers

  • Hi Riquel,

    For collect unhandled exception, I think you could try WCF Tracing.

    What the OS did you use to host WCF Service? For a built-in tool, I suggest you try AppFabric.

    # Introducing Windows Server AppFabric

    https://msdn.microsoft.com/en-us/library/ee677312(v=azure.10).aspx

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Riquel I'm Friday, June 30, 2017 5:12 PM
    Thursday, June 29, 2017 2:44 AM

All replies

  • Hi Riquel,

    Could you identify which part produces Stack exception or OutOfMemory exception?

    I am afraid we could not capture this exception from WCF Service sid due to that these errors will terminate the service.

    Pero to WCF Extensibility – IErrorHandler, we could get

    When an unhandled exception bubbles up from a service operation, ProvideFault is called for all error handlers registered in the list of handlers of the channel dispatcher (except for some “fatal” exceptions, such as stack overflows, out of memory, etc., in which case the service will be terminated).

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 28, 2017 2:29 AM
  • Hi Edward,

    Thanks for kind help. I understood that the coding can not catch these fatal exceptions(stackoverflow). 

    Is there any way to configure any Microsoft tools (Windows built-in) to automatically log these kind of unhandled fatal exceptions which can't be captured by the IErrorHandler implementation?

    Any idea?

    Thanks,


    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 28, 2017 3:05 PM
  • Actually I just want to have one good way to collect the fatal unhandled exception information to log for the maintenance and bug-fix. 

    Thanks again!


    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 28, 2017 3:17 PM
  • Hi Riquel,

    For collect unhandled exception, I think you could try WCF Tracing.

    What the OS did you use to host WCF Service? For a built-in tool, I suggest you try AppFabric.

    # Introducing Windows Server AppFabric

    https://msdn.microsoft.com/en-us/library/ee677312(v=azure.10).aspx

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Riquel I'm Friday, June 30, 2017 5:12 PM
    Thursday, June 29, 2017 2:44 AM