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 CS0203

Can't call a method on 'variable'

Method calls must be on an object and not on a pointer.

The following sample generates CS0203:

public class C2 {
   public C2 Current {
      get {
         return null;
      }
   }

   public bool MoveNext () {
      return false;
   }

   public C2 GetEnumerator () {
      return null;
   }
}

public class MainClass {
   unsafe public static void Main () {
      C2** c2 = null;
      foreach (C2 x in c2) {}   // CS0203
      // try the following line instead
      // foreach (C2 x in (*c2)) {}
      }
}