Marshal.Sizeof() returning unexpected value
问题 I'm debugging code in C# written by a 3rd party. The project is an old C++ project that was rewritten in C# by a contractor, and I have no access to the contractor. I authored the original C++ version. The issue is when the C# code gets the size of a structure that represents data received over a UDP connection. The struct is defined as: [StructLayout(LayoutKind.Sequential,Pack=1)] internal class PROXY_HDR { public ushort pad; public ushort label; public char flags; public ushort length;