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 CS0636

structoffset attribute can only be placed on members of type marked with the structlayout(LayoutKind.Explicit)

The structoffset attribute can only be used in structures that require explicit layout information.

The following sample generates CS0636:

using System;
using System.Interop;

[structlayout(LayoutKind.Sequential)]
struct Worksheet {
   [structoffset(4)]public int i;   // CS0636
   // try the following line instead
   // public int i;
}

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