82 instantiations of InvalidDataContractException
System.Private.DataContractSerialization (71)
System\Runtime\Serialization\ClassDataContract.cs (4)
642
throw new
InvalidDataContractException
(SR.Format(SR.ISerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type)));
663
throw new
InvalidDataContractException
(SR.Format(SR.AttributedTypesCannotInheritFromNonAttributedSerializableTypes,
675
throw new
InvalidDataContractException
(SR.Format(SR.OnlyDataContractTypesCanHaveExtensionData, DataContract.GetClrTypeFullName(type)));
1270
throw new
InvalidDataContractException
(SR.Format(SR.NonAttributedSerializableTypesMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\CollectionDataContract.cs (13)
356
throw new
InvalidDataContractException
(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
366
throw new
InvalidDataContractException
(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
460
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractItemName, DataContract.GetClrTypeFullName(UnderlyingType)));
467
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractKeyName, DataContract.GetClrTypeFullName(UnderlyingType)));
469
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName));
475
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractValueName, DataContract.GetClrTypeFullName(UnderlyingType)));
477
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractValueNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.ValueName));
549
throw new
InvalidDataContractException
(SR.Format(SR.CollectionMustHaveGetEnumeratorMethod, GetClrTypeFullName(type)));
551
throw new
InvalidDataContractException
(SR.Format(SR.CollectionMustHaveItemType, GetClrTypeFullName(type)));
572
throw new
InvalidDataContractException
(SR.Format(SR.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(type)));
1261
throw new
InvalidDataContractException
(GetInvalidCollectionMessage(message, SR.Format(SR.InvalidCollectionDataContract, DataContract.GetClrTypeFullName(type)), param));
1423
throw new
InvalidDataContractException
(InvalidCollectionInSharedContractMessage);
1431
throw new
InvalidDataContractException
(SR.Format(SR.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(UnderlyingType)));
System\Runtime\Serialization\DataContract.cs (14)
178
throw new
InvalidDataContractException
(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
185
throw new
InvalidDataContractException
(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
192
throw new
InvalidDataContractException
(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
197
throw new
InvalidDataContractException
(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
963
throw new
InvalidDataContractException
(message);
1171
throw new
InvalidDataContractException
(SR.Format(SR.RecursiveCollectionType, GetClrTypeFullName(itemType)));
1293
throw new
InvalidDataContractException
(SR.Format(SR.InvalidDataContractName, DataContract.GetClrTypeFullName(type)));
1305
throw new
InvalidDataContractException
(SR.Format(SR.InvalidDataContractNamespace, DataContract.GetClrTypeFullName(type)));
1405
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractName, DataContract.GetClrTypeFullName(type)));
1417
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractNamespace, DataContract.GetClrTypeFullName(type)));
1737
throw new
InvalidDataContractException
(SR.Format(SR.InvalidGlobalDataContractNamespace, clrNs));
1739
throw new
InvalidDataContractException
(SR.Format(SR.DataContractNamespaceAlreadySet, dataContractNs, nsAttribute.ContractNamespace, clrNs));
1921
throw new
InvalidDataContractException
(SR.Format(SR.GenericNameBraceMismatch, format, genericNameProvider.GetGenericTypeName()));
1939
throw new
InvalidDataContractException
(SR.Format(SR.GenericParameterNotValid, format.Substring(start, i - start), genericNameProvider.GetGenericTypeName(), genericNameProvider.GetParameterCount() - 1));
System\Runtime\Serialization\DataContractSet.cs (3)
75
throw new
InvalidDataContractException
(SR.Format(SR.GenericTypeNotExportable, type));
282
throw new
InvalidDataContractException
(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupported,
458
throw new
InvalidDataContractException
(SR.Format(SR.GenericTypeNameMismatch, dataContract.XmlName.Name, dataContract.XmlName.Namespace, genericXmlName.Name, genericXmlName.Namespace));
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (1)
72
throw new
InvalidDataContractException
(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(this.TraditionalDataContract.UnderlyingType)));
System\Runtime\Serialization\Json\JsonDataContract.cs (1)
56
throw new
InvalidDataContractException
(SR.Format(SR.SerializationCodeIsMissingForType, c.UnderlyingType));
System\Runtime\Serialization\ReflectionReader.cs (1)
608
throw new
InvalidDataContractException
(SR.Format(SR.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(collectionContract.UnderlyingType)));
System\Runtime\Serialization\SchemaExporter.cs (8)
537
throw new
InvalidDataContractException
(SR.Format(SR.MissingSchemaType, typeQName, DataContract.GetClrTypeFullName(clrType)));
598
throw new
InvalidDataContractException
(SR.Format(SR.InvalidXmlDataContractName, DataContract.GetClrTypeFullName(type)));
624
throw new
InvalidDataContractException
(SR.Format(SR.InvalidGetSchemaMethod, DataContract.GetClrTypeFullName(clrType)));
631
throw new
InvalidDataContractException
(SR.Format(SR.MissingGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName));
634
throw new
InvalidDataContractException
(SR.Format(SR.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(typeof(XmlQualifiedName)), typeof(XmlSchemaType)));
641
throw new
InvalidDataContractException
(SR.Format(SR.InvalidNonNullReturnValueByIsAny, DataContract.GetClrTypeFullName(clrType), methodName));
679
throw new
InvalidDataContractException
(SR.Format(SR.MissingSchemaType, typeName, DataContract.GetClrTypeFullName(clrType)));
704
throw new
InvalidDataContractException
(SR.Format(SR.InvalidReturnSchemaOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType)));
System\Runtime\Serialization\SchemaImporter.cs (13)
373
throw new
InvalidDataContractException
(SR.Format(SR.CannotComputeUniqueName, element.Name));
391
throw new
InvalidDataContractException
(SR.Format(SR.SpecifiedTypeNotFoundInSchema, typeName.Name, typeName.Namespace));
991
throw new
InvalidDataContractException
(SR.Format(SR.InvalidEmitDefaultAnnotation, memberName, typeName.Name, typeName.Namespace));
1028
throw new
InvalidDataContractException
(SR.Format(SR.AnnotationAttributeNotFound, SchemaExporter.DefaultValueAnnotation.Name, typeName.Name, typeName.Namespace, Globals.EmitDefaultValueAttribute));
1040
throw new
InvalidDataContractException
(SR.Format(SR.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace, Globals.ActualTypeNameAttribute));
1043
throw new
InvalidDataContractException
(SR.Format(SR.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace, Globals.ActualTypeNamespaceAttribute));
1287
throw new
InvalidDataContractException
(SR.Format(SR.GenericAnnotationAttributeNotFound, type.Name, Globals.GenericNameAttribute));
1290
throw new
InvalidDataContractException
(SR.Format(SR.GenericAnnotationAttributeNotFound, type.Name, Globals.GenericNamespaceAttribute));
1302
throw new
InvalidDataContractException
(SR.Format(SR.GenericAnnotationHasInvalidElement, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name));
1308
throw new
InvalidDataContractException
(SR.Format(SR.GenericAnnotationHasInvalidAttributeValue, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name, nestedLevelAttribute.Value, nestedLevelAttribute.LocalName, nameof(Int32)));
1311
throw new
InvalidDataContractException
(SR.Format(SR.GenericAnnotationForNestedLevelMustBeIncreasing, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name));
1323
throw new
InvalidDataContractException
(SR.Format(SR.GenericAnnotationHasInvalidAttributeValue, typeElement.LocalName, typeElement.NamespaceURI, type.Name, typeNestedLevelsAttribute.Value, typeNestedLevelsAttribute.LocalName, nameof(Int32)));
1471
throw new
InvalidDataContractException
(SR.Format(SR.TypeCannotBeImportedHowToFix, message));
System\Runtime\Serialization\XmlDataContract.cs (4)
141
throw new
InvalidDataContractException
(SR.Format(SR.IXmlSerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type)));
143
throw new
InvalidDataContractException
(SR.Format(SR.IXmlSerializableCannotHaveCollectionDataContract, DataContract.GetClrTypeFullName(type)));
177
throw new
InvalidDataContractException
(SR.Format(SR.IsAnyCannotHaveXmlRoot, DataContract.GetClrTypeFullName(UnderlyingType!)));
254
throw new
InvalidDataContractException
(SR.Format(SR.IXmlSerializableMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(UnderlyingType)));
System\Runtime\Serialization\XmlObjectSerializerContext.cs (1)
152
throw new
InvalidDataContractException
(SR.Format(SR.TypeNotSerializable, memberType));
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (3)
75
throw new
InvalidDataContractException
(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser, DataContract.GetClrTypeFullName(declaredType)));
96
throw new
InvalidDataContractException
(SR.Format(SR.TypeNotSerializable, memberType));
117
throw new
InvalidDataContractException
(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser,
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (2)
194
throw new
InvalidDataContractException
(SR.Format(SR.TypeNotSerializable, memberType));
215
throw new
InvalidDataContractException
(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser,
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
211
return new
InvalidDataContractException
(SR.Format(
System\Runtime\Serialization\XmlWriterDelegator.cs (1)
274
return new
InvalidDataContractException
(SR.Format(SR.InvalidPrimitiveType_Serialization, DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\XsdDataContractExporter.cs (1)
95
throw new
InvalidDataContractException
(SR.Format(SR.GenericTypeNotExportable, type));
System.Runtime.Serialization.Primitives (1)
System\Runtime\Serialization\DataMemberAttribute.cs (1)
36
throw new
InvalidDataContractException
(SR.OrderCannotBeNegative);
System.Runtime.Serialization.Schema (9)
System\Runtime\Serialization\Schema\CodeExporter.cs (7)
238
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.UnexpectedContractType, GetClrTypeFullName(dataContract.GetType()), GetClrTypeFullName(dataContract.UnderlyingType))));
265
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.TypeCannotBeImported, typeName.Name, typeName.Namespace, SR.Format(SR.CircularTypeReference, classContract.XmlName.Name, classContract.XmlName.Namespace))));
448
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.CannotComputeUniqueName, typeName)));
570
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.TypeMustBeIXmlSerializable, GetClrTypeFullName(type), GetClrTypeFullName(typeof(IXmlSerializable)), dataContract.XmlName.Name, dataContract.XmlName.Namespace)));
1131
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.InvalidClrNamespaceGeneratedForISerializable, classDataContract.XmlName.Name, classDataContract.XmlName.Namespace, SchemaImportHelper.GetDataContractNamespaceFromUri(classDataContract.XmlName.Namespace), contractCodeDomInfo.ClrNamespace)));
1141
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.InvalidClrNameGeneratedForISerializable, classDataContract.XmlName.Name, classDataContract.XmlName.Namespace, contractCodeDomInfo.TypeDeclaration.Name)));
1625
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.CannotComputeUniqueName, nsFragment)));
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (2)
409
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.AnnotationAttributeNotFound, ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace, ImportGlobals.ActualTypeNameAttribute)));
412
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.AnnotationAttributeNotFound, ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace, ImportGlobals.ActualTypeNamespaceAttribute)));
System.ServiceModel.Primitives (1)
System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
530
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(
14 references to InvalidDataContractException
netstandard (1)
netstandard.cs (1)
1773
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.
InvalidDataContractException
))]
System.Private.DataContractSerialization (9)
System\Runtime\Serialization\DataContract.cs (1)
2059
catch (
InvalidDataContractException
)
System\Runtime\Serialization\DataContractSet.cs (1)
377
catch (
InvalidDataContractException
)
System\Runtime\Serialization\SchemaImporter.cs (2)
415
InvalidDataContractException
invalidContractException;
491
catch (
InvalidDataContractException
e)
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
209
private static
InvalidDataContractException
CreateInvalidPrimitiveTypeException(Type type)
System\Runtime\Serialization\XmlWriterDelegator.cs (1)
272
private static
InvalidDataContractException
CreateInvalidPrimitiveTypeException(Type type)
System\Runtime\Serialization\XsdDataContractExporter.cs (3)
326
catch (
InvalidDataContractException
)
361
catch (
InvalidDataContractException
)
391
catch (
InvalidDataContractException
)
System.Runtime.Serialization (1)
System.Runtime.Serialization.cs (1)
20
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.
InvalidDataContractException
))]
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
384
catch (
InvalidDataContractException
)
System.Runtime.Serialization.Xml (1)
src\runtime\artifacts\obj\System.Runtime.Serialization.Xml\Release\net11.0\System.Runtime.Serialization.Xml.Forwards.cs (1)
14
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.
InvalidDataContractException
))]
System.ServiceModel.Primitives (1)
System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
528
catch (
InvalidDataContractException
e)