1

I have been reading a little material about 'CER', Constrained Execution Regions and ReliabilityContracts, and it seems like these are mostly intended to be used in .Net applications where there a) might be AppDomains that are created and destroyed over time, or b) calls to Thread.Abort.

Now although I write long-running server applications that I want to be reliable, I don't tend to use Thread.Abort or App Domains when I do. So I am curious, will learning Constrained Execution Regions help me write even more reliable apps, or are they useless to me? Are there benefits they can provide for simple server applications which don't do explicit thread aborts?

Tim Lovell-Smith
  • 15,310
  • 14
  • 76
  • 93
  • 1
    CERs were added in .NET 2.0 to deal with risky finalizers that could crash the host app when they fail. SQL Server was the primary beneficiary, the kind of high-availability server app that can't just be crashed by a query and make anybody happy about it. The SafeHandle classes use them, having to write your own is quite unusual. If you think you need a finalizer then you're almost always wrong. CERs were primarily advertised because .NET 1.x got a bad reputation, the sales-pitch was important. – Hans Passant Nov 20 '18 at 22:36
  • @Hans Passant thanks for yet another interesting comment/answer! – Tim Lovell-Smith Nov 21 '18 at 06:23

0 Answers0