Gracefully handling corrupted state exceptions

Instead of using <legacyCorruptedStateExceptionsPolicy> it would be better to use [HandleProcessCorruptedStateExceptions] (and [SecurityCritical]) as stated here: https://msdn.microsoft.com/en-us/magazine/dd419661.aspx Following that, your Main method should look something like this: [HandleProcessCorruptedStateExceptions, SecurityCritical] static void Main(string[] args) { try { … } catch (Exception ex) { // Log the CSE. } } But be aware that this doesn’t catch … Read more