title: Marshal.SizeOf error in computing size
body: <p>i have a structure </p>
  
  <pre><code> public struct SERVER_USB_DEVICE
          {
              USB_HWID usbHWID;
              byte status;
              bool bExcludeDevice;
              bool bSharedManually;
              ulong ulDeviceId;
              ulong ulClientAddr;
              [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
              string usbDeviceDescr;
              [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
              string locationInfo;
              [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
              string nickName;
          }
  </code></pre>
  
  <p>i am getting following error </p>
  
  <blockquote>
    <p>System.ArgumentException was unhandled
    Message="Type 'SERVER_USB_DEVICE'
    cannot be marshaled as an unmanaged
    structure; no meaningful size or
    offset can be computed."</p>
  </blockquote>
  
  <p>at following line </p>
  
  <pre><code>Marshal.SizeOf(typeof(USBOverNetWrapper.FT_SERVER_USB_DEVICE));
  </code></pre>
  
  <p>what is wrong in the code?</p>
  
  <p>Abdul Khaliq</p>