Will the expression provided to Debug.Assert be evaluated in a release build?
问题 Say I have a rather expensive assertion: bool IsCompatible(Object x, Object y) { // do expensive stuff here } If I test this assertion with: Debug.Assert(IsCompatible(x,y)); Will IsCompatible be executed in release builds? My understanding is that Debug.Assert being marked as [Conditional("DEBUG")], calls to it will only be emitted in debug builds. I'm thinking that this won't prevent the expression from being evaluated in release mode though, since the method call may have side effects, only