[Conditional("DEBUG")]
void Foo() {
}

The advantage here is that the code is not reachable anymore if the condition is not met. This means that it will result in compile errors if you reference this method. #if … #endif does not enforce this constraint.



Write a comment



    
Answer to Life, the Universe, and Everything is based on WordPress platform, RSS tech , RSS comments design by Gx3.