Hello,
When I use the following structure at the Load event I get a type load
exception.
[StructLayout(LayoutKind.Explicit)]
public struct TempStruct
{
[FieldOffset(0)]
public int a;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
[FieldOffset(0)]
public string b;
}
System.TypeLoadException: Could not load type 'TempStruct' from
assembly 'Onboard_HMI, Version=1.0.2704.38330, Culture=neutral,
PublicKeyToken=null' because it contains an object field at offset 0
that is incorrectly aligned or overlapped by a non-object field.
What is this problem?
Does anyone know a workaround or a fix to this problem?
Thanks.