Tag Archives: conditional attribute

Use the Conditional attribute to make a method non-callable in C#

The Conditional attribute makes a method callable depending on whether a compile-time constant is defined. If the constant is not defined, then the compiler ignores calls to that method. The following code makes the Test subroutine callable if either the … Continue reading

Posted in attributes, debugging | Tagged , , , , , , , , | Leave a comment