My .NET Core service uses some unmanaged DLLs. To make it robust, I want to be able to catch System.ExecutionEngineException
, which is caused by a defective DLL and which kills my complete process. My intention is to stop the thread, which called the DLL, so why should it not be allowed to catch it?
Note: in the former .NET 4.8 version of this code, I was able to use the System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions
attribute in my calling function, which allowed my to get those exceptions.
Is there a way to handle this also with .NET 9.0?