A Primer to Preprocessing Directives
Use the Visual Studio feature to comment out blocks of code while evolving the code at development time. If you find yourself doing this quite often (for example, to enable or disable some diagnostic code), you’re likely better off with conditional compilation using an
#if preprocessing directive. We won’t detail the preprocessing capabilities (which is really a misnomer in the world of C# because there’s no separate preprocessor stage in compilation) right now, but here’s the crux of it.
#define directive, a symbol can be defined for further use in conditional preprocessing directives like
#if. Blocks of code surrounded by
#endif are conditionally included in the source code analyzed by ...