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 CS0199

A static readonly field cannot be passed ref or out (except in a static constructor)

A readonly variable must have the same static usage as the constructor in which you want to pass it as a ref or out parameter.

The following sample generates CS0199:

class MyClass {
   public static readonly int TestInt = 6;

   static void TestMethod(ref int testInt) {
      testInt = 0;
   }

   MyClass() {
      TestMethod(ref TestInt);   // CS0199, TestInt is static
   }

   public static void Main() {
   }
}