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 CS0523

Struct member 'struct2 field' of type 'struct1' causes a cycle in the structure layout

The definitions of two structs include recursive references. Change the struct definitions such that each does not define itself on the other.

The following sample generates CS0523:

struct RecursiveLayoutStruct1 {
   public RecursiveLayoutStruct2 field;
}

struct RecursiveLayoutStruct2 {
   public RecursiveLayoutStruct1 field;   // CS0523
}

class MyClass {
   public static void Main() {
   }
}