 <p>Maybe GetBytes method doesn't work as you expect. This linqpad works fine for me:</p> <pre><code>void Main() { var result = ByteArrayToStructure&lt;Message&gt;(CreateMessageByteArray()); result.Dump(); } [StructLayout(LayoutKind.Sequential, Pack = 1)] struct Message { public int id; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)] public string text; } private static byte[] CreateMessageByteArray() { int id = 69; byte[] intBytes = BitConverter.GetBytes(id); string text = "test"; byte[] stringBytes = Encoding.UTF8.GetBytes(text); IEnumerable&lt;byte&gt; rv = intBytes.Concat(stringBytes); return rv.ToArray(); } static T ByteArrayToStructure&lt;T&gt;(byte[] bytes) where T : struct { var handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); var result = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T)); handle.Free(); return result; } </code></pre> <p>Output:</p> <pre><code>id 69 text test </code></pre>