[Mono-dev] ** ERROR **: Type System.DateTime which is passed to unmanaged code must have a StructLayout attribute aborting...
robertj at gmx.net
Sat Jul 11 18:05:14 EDT 2009
> I get this message when trying to run a project in Mono while using a COM
> dll. It errors whenever the constructor is called. Is there any way to get
> around this?
Mono does not support DateTime marshaling for COM interop. The only way
to fix this is to change the signature from DateTime to double and
use DateTime's ToOADate() and FromOADate() members:
void SomeMethod(DateTime dt)
void SomeMethod(double dt)
More information about the Mono-devel-list