[Mono-dev] Problem with custim marshaller on list

Guillaume ggdabuh at yahoo.fr
Thu Oct 15 16:21:30 UTC 2015


Hello,

I have made a custom marshaller for lists. My class is simple:
	[StructLayout(LayoutKind.Sequential)]
	struct Toto2
	{
		public Toto2(long a, IList<int> b):this()  {this.a = a; /*this.b = b;*/}
		public long a{ get; private set;}
		[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef =
typeof(CollectionMarshaller<List<int>, int>))]
		public IList<int> b;// { get; private set;}*/


	}
and I use that list to call a native method:
		[DllImport("thing", EntryPoint="foo")]
		public static extern void create(Toto2 arg);

when I call that method, I have this error:
marshaling type 15 not implemented
* Assertion: should not be reached at marshal.c:1952

as if my custom marshaller was not called ( I have put break points in the
constructor and the MarshalManagedToNative method, that do not trigger)
Is it a bug in Mono or in my code ? 

Thanks in advance,
Guillaume



--
View this message in context: http://mono.1490590.n4.nabble.com/Problem-with-custim-marshaller-on-list-tp4666760.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list