I have an internal consistency check in my program that verifies whether two runs of the same code, with the same inputs, give identical results. The idea is to detect unaccounted-for inputs, during development. If the check fails, it breaks into the debugger.
This is all fine and dandy until some other action in the debugger - especially Edit and Continue - modifies one run in the middle of execution. I want to detect this and disable the consistency check.
Obviously because the check itself requires the debugger, I can't do something simple like check Debugger.IsAttached
.