C# Language Preprocessor directives Generating Compiler Warnings and Errors

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Compiler warnings can be generated using the #warning directive, and errors can likewise be generated using the #error directive.

#if SOME_SYMBOL
#error This is a compiler Error.
#elif SOME_OTHER_SYMBOL
#warning This is a compiler Warning.
#endif


Got any C# Language Question?