question

YakirLevi-6541 avatar image
0 Votes"
YakirLevi-6541 asked YakirLevi-4143 commented

Is it possible to capture native unhandled exceptions in UWP apps?

Hello,

This continues https://social.msdn.microsoft.com/Forums/windowsapps/en-US/9cddf0bc-8277-4534-b2c5-a96b9012e569/uwpc-is-it-possible-to-capture-unhandled-exceptions?forum=wpdevelop
I have tried embedding CoreApplicationExceptionHandler::OnUnhandledException in my native code and indeed it has not helped at all.
1) If the capturing is set in C# (first) the native handler is not invoked. It is invoked only if there is no one before it. (In my test the handler propagates the exception).
2) Native crashes in non WinRT code are not caught by the handler.
As denoted in the old thread the Win32 native handler is not invoked as well.

So how can native exceptions be captured???

Thanks
Yakir

windows-uwpc++
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@YakirLevi-6541 Could you please tell me the way you call native dll in C# UWP project so that we can create a sample in my side for testing?

0 Votes 0 ·

A demo solution is available here: https://drive.google.com/file/d/1-6r-XrOe6cRhZduRNA2HnhLm7eKQlGFU/view?usp=sharing
Calling exported functions from C#: [DllImport("DLL_NAME")]
In our product we use SWIG.

0 Votes 0 ·

@YakirLevi-6541 I tried to find a way to capture the exception in dll or C#, but I found nothing works. I will consult high engineers for your case, and there may be some delay.

0 Votes 0 ·
Show more comments

0 Answers