I created a simple struct which consists of two value types.
public struct Identifier
{
public Guid ID { get; set; }
public Byte RequestType { get; s
By default the CLR is allowed to rearrange (which for simple structs it never does) and pad structs as it pleases. This is typically to keep it aligned to word boundaries when in memory.
If you don't like this behavior and want to change it, you can specify no packing as follows:
[StructLayout(LayoutKind.Sequential,Pack=1)]
Your Identifier
struct is padded with 3 bytes when copied to unmanaged memory for alignment reasons.