C# preprocessor directives for conditional compilation

By Santhosh N

This list out all the available preprocessor directives in Microsoft .Net C# Language which helps developers to conditionally compile the applications while coding.

Following are the different preprocessor directives available to C# developers in Visual Studio 2010 version (with .Net Framework 4.0 version):

1. #if
2. #else
3. #elif
4. #endif
5. #define
6. #undef
7. #warning
8. #error
9. #line
10.#region
11.#endregion
12.#pragma
13.#pragma warning
14.#pragma checksum

Related FAQs

This explains how to find the version of the Microsoft Excel that has been installed in the system.
This explains how to make C# windows Forms TextBox accept only numeric values.
This explains the location of the Strong Name Generator Tool, sn.exe in Microsoft .Net 4.0 version when Visual Studio 2010 is installed.
C# preprocessor directives for conditional compilation  (1026 Views)