|
|
@@ -188,6 +188,9 @@ namespace System.Xml.Serialization {
|
|
|
XmlTypeMapping map = helper.GetRegisteredClrType (type, GetTypeNamespace (typeData, root, defaultNamespace));
|
|
|
if (map != null) return map;
|
|
|
|
|
|
+ if (type.GetConstructor (Type.EmptyTypes) == null && !type.IsAbstract)
|
|
|
+ throw new InvalidOperationException (type.Name + " cannot be serialized because it does not have a default public constructor");
|
|
|
+
|
|
|
map = CreateTypeMapping (typeData, root, null, defaultNamespace);
|
|
|
helper.RegisterClrType (map, type, map.Namespace);
|
|
|
helper.RegisterSchemaType (map, map.XmlType, map.Namespace);
|