BinarySerializer: Problem updating to new version

Hi, I’m upgrading from 7.5.7 to 8.4.2 but now something’s broken.

{System.InvalidOperationException: There was an error reflecting member 'Fields' ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Lists must define one and only one generic argument in the list object hierarchy.
   at BinarySerialization.Graph.TypeGraph.ListTypeNode.GetChildType()
   at BinarySerialization.Graph.TypeGraph.CollectionTypeNode.Construct()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at BinarySerialization.Graph.TypeGraph.ContainerTypeNode.GenerateChild(Type parentType, MemberInfo memberInfo)
   --- End of inner exception stack trace ---
   at BinarySerialization.Graph.TypeGraph.ContainerTypeNode.GenerateChild(Type parentType, MemberInfo memberInfo)
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at BinarySerialization.Graph.TypeGraph.ObjectTypeNode.GenerateChildren(Type parentType)
   at BinarySerialization.Graph.TypeGraph.ObjectTypeNode.Construct(Boolean isSubType)}

This is the code it’s refering to:

        [FieldOrder(8)]
        [FieldLength("Size", ConverterType = typeof(HeaderSizeToFieldLengthConverter), BindingMode = BindingMode.OneWay)]
        public ObservableCollection<NcpField> Fields { get; set; }

No idea what’s wrong. Help? 😃

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

ok, upon further reflection I decided there was no real reason to prevent this. fixed in 8.4.3