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 CS1510

A ref or out argument must be an lvalue

Only a variable can be passed as a ref parameter in a method call. A ref value is similar to passing a pointer.

The following sample generates CS1510:

public class C {
   public static int i = 0;

   public static void mf(ref int i) {
      i++;
   }

   public static void Main () {
      mf (ref 1);   // CS1510, can't pass a number as a ref parameter
      // try the following to resolve the error
      // mf (ref i);
   }
}