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(); } }