I've been trying to get the size of a
sizeof won't work because I have to compile with the unsafe flag, and this feature isn't enough of a justification to do that. Marshal.SizeOf throws an exception:
Type 'System.DateTimeOffset' cannot be marshaled as an unmanaged
structure; no meaningful size or offset can be computed.
It occupies 10 bytes.
Looking at the source, it has an
Int16 and a
DateTime has a single
I have no idea why
Marshal.SizeOf can't measure it.