Thursday, March 24, 2011

Does anyone have a list of all the Visual Studio C# pragma names?

In C++, there was a #pragma to output to the build log. Does one exist for Visual Studio 2005 C# ? And, does anyone know where an actual list of all the #pragma names can be found?

From stackoverflow
  • See the MSDN docs.

  • According to the docs, pragmas must be supported by the compiler, and only two are currently supported: checksum and warning.

  • This link on msdn lists all the C# preprocessor directives and goes into detail about how they are used.

    #if
    #else 
    #elif 
    #endif 
    #define 
    #undef 
    #warning 
    #error 
    #line 
    #region 
    #endregion 
    #pragma 
    #pragma warning 
    #pragma checksum
    

    Only warning and checksum are supported #pragma instructions for the C# compiler.

0 comments:

Post a Comment