OlavT
OlavT

Reputation: 2666

How to find reason for 'System.Runtime.InteropServices.SEHException' occurred in System.Private.CoreLib.ni.dll?

I have written a Windows 10 IoT (UWP) application running on a Raspberry PI 3. The application is a client to Azure IoT Hub and is also using interfaces to Azure Event Hub and Azure Table Storage.

Once now and then I get the following exception logged to the Output window in VS 2017:

An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in System.Private.CoreLib.ni.dll External component has thrown an exception.

I’m running the app in VS 2017 to try to figure out why the application crashes. It typically runs fine for several days until it crashes with this error.

It doesn’t seem like the crash is caused by my own code. None of my own exception handlers are invoked and I don’t see any relevant call stack info.

Does anyone know how to nail down a crash like this?

Upvotes: 1

Views: 8278

Answers (1)

OlavT
OlavT

Reputation: 2666

Make sure that "Break When Thrown" is enabled for the exception type (settings are in Debug -> Windows -> Exceptions). This will cause the debugger to stop where the problem occurs and makes it easier to figure out where the problem is.

Upvotes: 5

Related Questions