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!

/define (Preprocessor Definition)

/define:name[;name2]

where:

name[;name2]
The name of one or more symbols that you want to define.

Remarks

The /define option defines name as a symbol in your program. It has the same effect as using a #define preprocessor directive in your source file. A symbol remains defined until an #undef directive in the source file removes the definition or the compiler reaches the end of the file.

You can use symbols created by this option with #if, #else, #elif, and #endif to compile source files conditionally.

/d is the short form of /define.

You can define multiple symbols with /define by using a semicolon or comma to separate symbol names. For example:

/define:DEBUG;TUESDAY

Example

// compile with /define:xx or uncomment the next line
// #define xx
using System;
public class Test 
{
   public static void Main() 
   {
      #if (xx) 
         Console.WriteLine("xx exists");
      #else
         Console.WriteLine("xx does not exist");
      #endif
   }
}

See Also

C# Compiler Options