NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

#undef

#undef lets you undefine a symbol, such that, by using the symbol as the expression in a #if directive, the expression will evaluate to false.

#undef symbol

where:

symbol
The name of the symbol you want to undefine.

Remarks

A symbol can be defined either with the #define directive or the /define compiler option. The #undef directive must appear in the file before you use any statements that are not also directives.

Example

// compile with /D:DEBUG
#undef DEBUG
using System;
public class MyClass {
   public static void Main() {
      #if DEBUG
         Console.WriteLine("DEBUG is defined");
      #else
         Console.WriteLine("DEBUG is not defined");
      #endif
   }
}

Output

DEBUG is not defined

See Also

C# Preprocessor Directives