Joe Duffy has a post on avoiding and surviving rude AppDomain unloads. This is a useful post and all, but the highpoints are the following 2 quotes:
... if you piss SQL Server off by taking too long in one of your finally blocks (for example), it will get a tad snippyand:
It uses a great method RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup located in the System.Runtime.CompilerServices namespace. We call it SRCSRHECWGC—pronounced “shreek shreck woogy-cuck”—for short around here.Mmmm shreek shreck woogy-cuck.
[Listening to: Eminem - Kids]