Conditional Compilation

Although debugging techniques can help you iron out problems in your code, you may want to simply add chunks of code at compile time (if you're currently in the debugging phase of your project) or remove the same chunks when you release your code. Conditional compilation makes it possible to add and remove chunks from the executable.

Conditional compilation relies on compiler directives in your code that indicate to the compiler, as it's compiling your code, how it should use the code. Compiler directives are #If statements that direct the compiler as to which code it should leave in and which code it should leave out. For example, you might wish to put debugging code in your application, but when you create a final compile, ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.