structoffset not allowed on static or const fields
The structoffset attribute cannot be used on fields marked with static or const.
The following sample generates CS0637:
using System; using System.Interop; [structlayout(LayoutKind.Explicit)] public class MainClass { [structoffset(3)] // CS0637 public static int i; public static void Main () { } }