Code demonstrating the importance of a Constrained Execution Region

前端 未结 5 2202
耶瑟儿~
耶瑟儿~ 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:45

    Are you running the MSDN sample under the debugger? I do not think it is possible for CER to function when you are executing within the debugger, as the debugger itself changes the nature of execution anyway.

    If you build and run the app in optimized release mode, you should be able to see it fail.

提交回复
热议问题