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!

Compiler Error CS0026

Keyword this is illegal in a static property, static method, or static field initializer

The this keyword is not allowed in static methods; you must have an instance before you can refer to an object with this.

The following sample generates CS0026:

public class a {
   public static int i = 0;
   public static void Main() {
      this.i = this.i + 1;   // CS0026
      // try the following line instead
      // i = i + 1;
   }
}