Conditions when finally does not execute in a .net try..finally block

Basically I've heard that certain conditions will cause .net to blow past the finally block. Does anyone know what those conditions are?


Two possibilities:

  • StackOverflowException
  • ExecutionEngineException

The finally block will not be executed when there's a StackOverflowException since there's no room on the stack to even execute any more code. It will also not be called when there's an ExecutionEngineException, which may arise from a call to Environment.FailFast().


Unless the CLR blows up and goes down with an ExecutingEngineException (I've seen a few in the .net 1.1 days with just the right amount of COM Interop :) .. I think finally should always execute.