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 CS0027

Keyword this is not available in the current context

The this keyword was found outside of a property, method, or constructor.

The following sample generates CS0027:

using System;
class CMyClass {
   int err1 = this.fun() + 1;   // CS0027
   public int fun() {
      return 10;
   }
   public void x() {
      int err = this.fun() + 1;   // valid use of this
      Console.WriteLine(err);
   }
   public static void Main() {
      CMyClass c = new CMyClass();
      c.x();
   }
}