title: Getting the size of a field in bytes with C#
body: <p>I have a class, and I want to inspect its fields and report eventually how many bytes each field takes. I assume all fields are of type  Int32, byte, etc.</p>
  
  <p>How can I find out easily how many bytes does the field take?</p>
  
  <p>I need something like:</p>
  
  <pre><code>Int32 a;
  // int a_size = a.GetSizeInBytes;
  // a_size should be 4
  </code></pre>