MarshalAs attribute?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the MarshalAs attribute like so:

[MarshalAs(UnmanagedType.ByValArray, SizeConst=0)]
byte[] m_bytes

but when I compile I get the error

The type or namespace name 'MarshalAs' could not be found (blah blah...)

I am referencing mscorlib.dll version 2.0.5238.0, and I note that the
MarshaAs attribute does not appear in the object browser. The docs say that
it should be found in mscorlib. Is there a newer version? Should I be
referenceing another dll?

Thx
Helen
 
It's there. Make sure it's a Smart Devices project and don't forget the:
using System.Runtime.InteropServices;

HTH... Alex
 
Back
Top