diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML/MessageSerializer.cs b/src/impl/Serializers/NServiceBus.Serializers.XML/MessageSerializer.cs index 6f081ce57cd..673f5c1cc39 100644 --- a/src/impl/Serializers/NServiceBus.Serializers.XML/MessageSerializer.cs +++ b/src/impl/Serializers/NServiceBus.Serializers.XML/MessageSerializer.cs @@ -76,6 +76,8 @@ public List MessageTypes /// public void InitType(Type t) { + logger.Debug("Initializing type: " + t.AssemblyQualifiedName); + if (t.IsSimpleType()) return; @@ -130,6 +132,8 @@ public void InitType(Type t) foreach (var p in props) { + logger.Debug("Handling property: " + p.Name); + propertyInfoToLateBoundProperty[p] = DelegateFactory.Create(p); if (!isKeyValuePair) @@ -140,6 +144,8 @@ public void InitType(Type t) foreach (var f in fields) { + logger.Debug("Handling field: " + f.Name); + fieldInfoToLateBoundField[f] = DelegateFactory.Create(f); if (!isKeyValuePair) @@ -162,17 +168,17 @@ IEnumerable GetAllPropertiesForType(Type t, bool isKeyValuePair) foreach (var prop in t.GetProperties()) { if (typeof(IList) == prop.PropertyType) - throw new NotSupportedException("IList is not a supported property type for serialization.Type: " + t.FullName + " Property: " + prop.Name); + throw new NotSupportedException("IList is not a supported property type for serialization, use List instead. Type: " + t.FullName + " Property: " + prop.Name); var args = prop.PropertyType.GetGenericArguments(); if (args.Length == 1) if (typeof(IList<>).MakeGenericType(args) == prop.PropertyType) - throw new NotSupportedException("IList is not a supported property type for serialization. Type: " + t.FullName + " Property: " + prop.Name); + throw new NotSupportedException("IList is not a supported property type for serialization, use List instead. Type: " + t.FullName + " Property: " + prop.Name); if (args.Length == 2) if (typeof(IDictionary<,>).MakeGenericType(args) == prop.PropertyType) - throw new NotSupportedException("IDictionary is not a supported property type for serialization. Type: " + t.FullName + " Property: " + prop.Name + ". Consider using a concrete Dictionary instead."); + throw new NotSupportedException("IDictionary is not a supported property type for serialization, use Dictionary instead. Type: " + t.FullName + " Property: " + prop.Name + ". Consider using a concrete Dictionary instead."); if (!prop.CanWrite && !isKeyValuePair) continue;