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 CS0637

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 () {
   }
}