I was recently going through some code and considering whether I need to be careful with the expressions placed inside Debug.Assert
statements, such as expensive op
The methods on the debugger use the pseudo-custom attribute, ConditionalAttribute, which the compiler detects and removes any calls to any methods with that attribute unless the specified compilation symbol (in this case, DEBUG
) is defined. Anyone may use the attribute on void
methods without any out
parameters.