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 CS0625

'field' : Instance field types marked with structlayout(LayoutKind.Explicit) must have a structoffset attribute.

When a struct is marked with an explicit structlayout attribute, all fields in the struct must have the structoffset attribute.

The following sample generates CS0625:

using System;
using System.Interop;

[structlayout(LayoutKind.Explicit)]
struct Worksheet {
   // uncomment the next line to resolve
   // [structoffset(5)]
   public int i;   // not marked static, i.e., an instance field
}

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