ContentSerializer(Optional = true) doesn't work for me


My xml data description class has a lot of optional elements and unfortunately deserialization of this elements causes exception (field must be defined). The data description project is compiled using the references to dlls built with MonoGame develop branch. I’ve tracked the problem to the following line:

 var attrib = ReflectionHelpers.GetCustomAttribute<ContentSerializerAttribute>(member);

ReflectiveSerializer.GetElementInfo(IntermediateSerializer serializer, MemberInfo member, out ElementInfo info)

Even though the field member holds the optional attribute I always get null (GetCustomAttribute calls internally function from mscorlib). I’ve run MonoGame test and checked this exactly same line and it works fine - returns the attribute. The only difference I see here is that my classes are compiled into library dll and then referenced in Pipeline tool whereas tests and data classes exist in same assembly. Please help:)

Ok I was stupid - had incorrect MonoGame.Framework assembly referenced in Pipeline tool (WindowsPhone81 version whereas data classes assembly referenced Windows).