Code demonstrating the importance of a Constrained Execution Region

前端 未结 5 2186
耶瑟儿~
耶瑟儿~ 2020-12-23 00:04

Could anyone create a short sample that breaks, unless the [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] is applied?

5条回答
  •  伪装坚强ぢ
    2020-12-23 00:23

    CER attributes are means of documentation. They do influence how CLR will execute code in some situations, but I believe they (or lack of them) will never result in error in current versions of .NET.

    They are mostly 'reserved for future use'.

提交回复
热议问题