Top "Structlayout" questions

Why does LayoutKind.Sequential work differently if a struct contains a DateTime field?

Why does LayoutKind.Sequential work differently if a struct contains a DateTime field? Consider the following code (a console app …

c# datetime marshalling structlayout
Is there an alternative for StructLayout "Pack" attribute in Compact Framework?

I would like to do the following: [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SomeStruct { public byte SomeByte; public int SomeInt; …

c# struct compact-framework structlayout