Size of managed type
How do I get size of managed type in c#
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Kirtan PatelRank #292 · 8.6K reputationPosted Apr 19, 2009, 1:15 AM EDT
use Marshal.SizeOf() to determine the Size of Managed Type
Happy Coding :)
Devora3 reputationPosted Apr 19, 2009, 4:59 AM EDT
Thanks for your reply,
I had tried the Marshal.SizeOf(). but when I did the following exception was thrown:
"cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed."
Kirtan PatelRank #292 · 8.6K reputationPosted Apr 19, 2009, 6:35 AM EDT
Happy Coding :)