Errors on execution

This is a description of most error messages that can be displayed by each DLL.
These errors are displayed as Exceptions or logged in the debugger ("Out" window).

Error categories

There are 3 very different kinds of error:

  1. You have designed a type in a way that make it incompatible with UniversalSerializer.
    Please read Good practices, that may help you in adapting your type.
    If the type comes from an external DLL, please inform its author about UniversalSerializer.
  2. A framework (.NET, .NET Core, Silverlight, Mono, Xamarin etc) type is not managed correctly.
    It may require an adaptation in UniversalSerializer. I do not consider that as a true error, it only means a standard type needs more consideration (that is creation of filters or containers).
  3. A general problem in UniversalSerializer.
    That will let me correct a problem that can potentially affect many programmers.

Error messages in UniversalSerializer 3 for NET x_y.dll

  1. Error 1 : This version of UniversalSerializer can not manage multi-dimensional arrays.
    Multi-dimensional array and not-0-based array serializations are not implemented yet.
  2. Error 2 : Unknown CustomFormatter.
    An unknown custom Formatter for serialization is set in the Parameters. Internal formatters are Binary, XML and JSON. Please note JSON is not available on some frameworks.
  3. Error 3 : Unknown CustomDeFormatter.
    An unknown custom Formatter for deserialization is set in the Parameters. Internal formatters are Binary, XML and JSON. Please note JSON is not available on some frameworks.
  4. Error 4 : Can not set field '{0}'.'{1}' of type '{2}' with value '{3}' of type '{4}'
    On deserialization. Most probably a field was removed in a new version of the type. Please contact me if it is a .NET type (not a custom type).
  5. Error 5 : Can not set property '{0}'.'{1}' of type '{2}' with value '{3}' of type '{4}'
    On deserialization. Most probably a property was removed in a new version of the type. Please contact me if it is a .NET type (not a custom type).
  6. Error 6 : Type not found: \"{0}\".
    Can happen during deserialization. Maybe the original type is not available anymore, or has been renamed. Please contact me if it is a .NET type (not a custom type).
  7. Error 7 : Unknown file version.
    The file stream is damaged, or you try to deserialize using an obsolete version of the serializer's DLL.
  8. Error 8 : Type '{0}' (or one of its sub-data) is not serializable by BCL's BinaryFormatter. (suggestion: try to remove attribute [Serializable], or add an exploitable constructor).
    On serialization. The type has SerializableAttribute as an attribute, therefore UniversalSerializer uses the BCL BinaryFormatter's function to transcode the instance to a byte array. Unfortunately, this particular function does not work correctly.
    Usually, this is due to a missing or inadequate constructor.
    If you can modify this type, please read this document.
    If not, please contact me and/or add yourself the incorrect type to  CLRBinaryFormatterContainer._IsValidType(), in CLRBinaryFormatterContainer.cs.
  9. Error 9 : data is not a Primitive type
    An internal error. Please contact me.
  10. Error 10 : Can not cast deserialized type \"{0}\" to wanted type \"{1}\".
    An internal error. After a successful deserialization, the type is wrong. Please contact me.
  11. Error 11 : Construction (instantiation) of type \"{0}\" caused an error: {1}.
    We called a constructor of the type, but that has raised an exception. Maybe the type has been modified between the serialization and the deserialization.
  12. Error 12 : No exploitable constructor for type {0}
    On deserialization. UniversalSerializer does found an exploitable constructor. No default constructor, no parametric constructor.
    If you can modify this type, please provide a parametric constructor that follows these rules.
    If not, you can create a Container. If it is a framework type, please contact me.
  13. Error 13 : Type {0} has no Add() method nor [Insert() method and Count get method], we can not set its items.
    The type is an enumeration, not a List. UniversalSerializer needs to be able to add items to this enumeration in order to deserialize it. It tried to find an adequate method, Add or Insert, but did not found one.
    If you can modify this type, you can inherit it from IList<>. More information here.
  14. Error 14 : Type \"{0}\" can not be constructed because this parameter's type has been disallowed by a filter: Parameter's name=\"{1}\", Corresponding field's name=\"{2}\", Type=\"{3}\".\n\tSuggestion: use a filter to disallow the main type, or to allow the parameter's type.
    If one of your Filters disallows a field and the parametric constructor needs this field, you have to take a decision: remove this filter or add a new constructor (if you can modify this type).
    Same problem with the Attributes.
  15. Error 15 : The type '{0}' uses {1} as TypeConverter, but it does not convert to string correctly. Please investigate or contact the type's author.
    The type has TypeConverterAttribute as an attribute, therefore UniversalSerializer uses the provided special function to transcode the instance to a string. Unfortunately, this function does not work correctly.
    If you can modify this type, please remove this attribute.
    If not, please contact me and/or add yourself the incorrect type to  CLRTypeConverterContainer._IsValidType(), in CLRTypeConverterContainer.cs.
  16. Error 16 : The type '{0}' uses {1} as TypeConverter, but its transcoding type is unknown. Please investigate or contact the type's author.
    The type has TypeConverterAttribute as an attribute, therefore UniversalSerializer uses the provided function to transcode the instance to a string. Unfortunately, this function does not work correctly.
    If you can modify this type, please remove this attribute.
    If not, please contact me and/or add yourself the incorrect type to  CLRTypeConverterContainer._IsValidType(), in CLRTypeConverterContainer.cs.
  17. Error 17 : Listed assembly in stream can not be loaded: \"{0}\". Error={1}
    Occurs when deserializing a type which assembly can not be loaded.
    Type's assemblies are listed in the stream on serialization and are necessary for deserialization.
  18. Error 18 : Warning: DateTimeKind has more than 4 items now. That will cause problems in DateTimes. See ToTicksAndKind().
    Apparently, .NET's DateTimeKind implementation has changed. UniversalSerializer has to be adapted consequently.
  19. Error 19 : Type {0} can not be deserialized because of 1) an error in its Container and 2) a refused private field.
    Two cumulative reasons: The container of this type has been canceled on serialization, probably because it was not able to contain this value. And, one (or more) private fields is (are) refused by a filter because of its type.
    If you can modify this type, remove the container or attribute that cause this error, or remove the private field that is refused by the filters, or modify the filter.
    If not, please contact me.
  20. Error 20 : (internal) Can not create a TypeManager for type {0}.
    If it is under Silverlight, it may be due to another type, please see sub-exceptions until you find "Error 21".
    If not Silverlight, that is an unexpected error, please inform me then I can study it.
  21. Error 21 : Silverlight does not allow creation of a TypeManager for private type {0}.
    There is a strong security protection in Silverlight that limits type access (usually: a private type in another assembly).
    This version of UniversalSerializer can not serialize this type.
    Suggestion: for now, try to avoid this type or any type that contains it as a field or a property.
    Sorry, I have no solution at this time.
  22. Error 22 : Type {0} has a circular type in its constructor parameters in a form that is not supported by the deserializer.
    This type is constructed by a parametric constructor. One (or more) of its parameters is a circular type.
    Two situations are not supported:
    • When a not-indexed Enumerable contains this type, or
    • when there is a Dictionary<T1, T2> where T1 and T2 are circular types.
      Possible solutions:
    • Add a default constructor to the main type.
    • Use IList in place of not-indexed Enumerables.
    • Avoid this kind of dictionary.
      If you can not modify this type, please create a Container, or a Filter, or contact me.

Error messages in UniversalSerializer 3 for WPF on NET 4_5.dll

  1. Error WPF 1 : No public static field DependencyProperty {0} of type {1} found in type {2}.
    Occurs when deserializing a DependencyProperty. The type does not define the required field.
    Normally, for each dependency property, a static field should be defined. Example, Window has an Icon property, and the static definition of Window has an IconProperty field.
    The static field must have the same name as the DependencyProperty, more "Property".
  2. Error WPF 2 : The type '{0}' uses {1} as ValueSerializer, but it was not transcoded correctly. Please investigate or contact the author.
    The type has ValueSerializerAttribute as an attribute, therefore UniversalSerializerWPF uses the provided function to transcode the instance to a string. Unfortunately, this function does not work correctly.
    If you can modify this type, please remove this attribute.
    If not, please contact me and/or add yourself the incorrect type to  XAMLValueSerializerContainer._IsValidType(), in XAMLValueSerializerContainer.cs.

Error messages in UniversalSerializer 3 Windows Forms for NET x_y.dll

There is no public error message for now.

'Bugs' or defects ?

What "bugs" ? You will find products to kill bugs at your local store, if there are any in your computer or in your house !   ;)

More seriously, this word, 'bug', was a joke on the first decades of computers (1940-1960). At that time, computers were big mechanical monsters where small animals could enter in and give pretexts to programmers.
60 years after, I feel this word has not much sense anymore. Today, it is no more a joke, only a technical word that makes nobody laugh. We even inherited this horrible neologism, 'debugger', that has really no sense to young living programmers.

For me, it is time to replace 'bug' by 'error', 'problem', 'defect', 'flaw' or anything else. Something clear to programmers and to the public in general.

If you want to do jokes, please invent something adapted to the modern reality. Be inventive!

By the way, if you find defects in UniversalSerializer, I will not pretend they are due to small animals, virus, secret government agencies intrusions or to ETs.
Or maybe I'll reply that if I'm looking for a huge pretext, after all !   ;)