Search Issue Tracker
Fixed in 4.6.5
[IL2CPP] Marshal.SizeOf dosen't work with types which have an explicitly defined size
1. Deploy the attached project with Il2CPP.
2. Notice the, error:
ArgumentException: Type 'CustomType' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed.
at System.Runtime.InteropServices.Marshal.SizeOf (System.Type t) [0x00000] in <filename unknown>:0
at Test..cctor () [0x00000] in <filename unknown>:0
(works fine with mono).
3. Only happens with types which have a StructLayout attribute.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- 'Can't add script' pop-up warns about abstract classes when dragging static classes onto GameObjects
- [Hub] Project "Remove from list" option is behind notifications when selecting the most bottom project in the list
- [Android][Vulkan] Black Screen renders on devices with Adreno 640 and Mali GPU's
- Sound/Audio is played when the VideoPlayer's attached AudioSource game object is disabled
- A Parser Failure error is thrown after importing a specific Animation file to a Unity project