I need to get fieldinfo in a guaranteed order with respect to declaration order. Right now I\'m using attributes to specify order.
Is there a more automatic way of d
LayoutKind.Sequential specifies that the fields of the type should be laid out in memory in the same order they are declared in your source code.
Without the attribute the CLR is free to optimize memory use by rearranging the fields.
So the attribute just adds metadata that tells the CLR not to do any in memory optimalisation that messes up the order of fields.