84 instantiations of InvalidDataContractException
System.Private.DataContractSerialization (73)
System\Runtime\Serialization\ClassDataContract.cs (4)
639
throw new
InvalidDataContractException
(SR.Format(SR.ISerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type)));
660
throw new
InvalidDataContractException
(SR.Format(SR.AttributedTypesCannotInheritFromNonAttributedSerializableTypes,
672
throw new
InvalidDataContractException
(SR.Format(SR.OnlyDataContractTypesCanHaveExtensionData, DataContract.GetClrTypeFullName(type)));
1267
throw new
InvalidDataContractException
(SR.Format(SR.NonAttributedSerializableTypesMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type)));
System\Runtime\Serialization\CollectionDataContract.cs (13)
355
throw new
InvalidDataContractException
(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
365
throw new
InvalidDataContractException
(SR.Format(SR.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType)));
459
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractItemName, DataContract.GetClrTypeFullName(UnderlyingType)));
466
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractKeyName, DataContract.GetClrTypeFullName(UnderlyingType)));
468
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName));
474
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractValueName, DataContract.GetClrTypeFullName(UnderlyingType)));
476
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractValueNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.ValueName));
548
throw new
InvalidDataContractException
(SR.Format(SR.CollectionMustHaveGetEnumeratorMethod, GetClrTypeFullName(type)));
550
throw new
InvalidDataContractException
(SR.Format(SR.CollectionMustHaveItemType, GetClrTypeFullName(type)));
571
throw new
InvalidDataContractException
(SR.Format(SR.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(type)));
1258
throw new
InvalidDataContractException
(GetInvalidCollectionMessage(message, SR.Format(SR.InvalidCollectionDataContract, DataContract.GetClrTypeFullName(type)), param));
1419
throw new
InvalidDataContractException
(InvalidCollectionInSharedContractMessage);
1427
throw new
InvalidDataContractException
(SR.Format(SR.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(UnderlyingType)));
System\Runtime\Serialization\DataContract.cs (16)
171
throw new
InvalidDataContractException
(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
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)));
190
throw new
InvalidDataContractException
(SR.Format(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
937
throw new
InvalidDataContractException
(message);
1145
throw new
InvalidDataContractException
(SR.Format(SR.RecursiveCollectionType, GetClrTypeFullName(itemType)));
1267
throw new
InvalidDataContractException
(SR.Format(SR.InvalidDataContractName, DataContract.GetClrTypeFullName(type)));
1279
throw new
InvalidDataContractException
(SR.Format(SR.InvalidDataContractNamespace, DataContract.GetClrTypeFullName(type)));
1347
throw new
InvalidDataContractException
(SR.Format(SR.TooManyDataContracts, DataContract.GetClrTypeFullName(type)));
1372
throw new
InvalidDataContractException
(SR.Format(SR.TooManyCollectionContracts, DataContract.GetClrTypeFullName(type)));
1379
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractName, DataContract.GetClrTypeFullName(type)));
1391
throw new
InvalidDataContractException
(SR.Format(SR.InvalidCollectionContractNamespace, DataContract.GetClrTypeFullName(type)));
1711
throw new
InvalidDataContractException
(SR.Format(SR.InvalidGlobalDataContractNamespace, clrNs));
1713
throw new
InvalidDataContractException
(SR.Format(SR.DataContractNamespaceAlreadySet, dataContractNs, nsAttribute.ContractNamespace, clrNs));
1895
throw new
InvalidDataContractException
(SR.Format(SR.GenericNameBraceMismatch, format, genericNameProvider.GetGenericTypeName()));
1913
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));
275
throw new
InvalidDataContractException
(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupported,
451
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)));
601
throw new
InvalidDataContractException
(SR.Format(SR.InvalidXmlDataContractName, DataContract.GetClrTypeFullName(type)));
627
throw new
InvalidDataContractException
(SR.Format(SR.InvalidGetSchemaMethod, DataContract.GetClrTypeFullName(clrType)));
634
throw new
InvalidDataContractException
(SR.Format(SR.MissingGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName));
637
throw new
InvalidDataContractException
(SR.Format(SR.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(Globals.TypeOfXmlQualifiedName), typeof(XmlSchemaType)));
644
throw new
InvalidDataContractException
(SR.Format(SR.InvalidNonNullReturnValueByIsAny, DataContract.GetClrTypeFullName(clrType), methodName));
682
throw new
InvalidDataContractException
(SR.Format(SR.MissingSchemaType, typeName, DataContract.GetClrTypeFullName(clrType)));
707
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, Globals.TypeOfInt.Name));
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, Globals.TypeOfInt.Name));
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)
69
throw new
InvalidDataContractException
(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser, DataContract.GetClrTypeFullName(declaredType)));
90
throw new
InvalidDataContractException
(SR.Format(SR.TypeNotSerializable, memberType));
111
throw new
InvalidDataContractException
(SR.Format(SR.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser,
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (2)
188
throw new
InvalidDataContractException
(SR.Format(SR.TypeNotSerializable, memberType));
209
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))));
441
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.CannotComputeUniqueName, typeName)));
560
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.TypeMustBeIXmlSerializable, GetClrTypeFullName(type), GetClrTypeFullName(typeof(IXmlSerializable)), dataContract.XmlName.Name, dataContract.XmlName.Namespace)));
1116
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.InvalidClrNamespaceGeneratedForISerializable, classDataContract.XmlName.Name, classDataContract.XmlName.Namespace, SchemaImportHelper.GetDataContractNamespaceFromUri(classDataContract.XmlName.Namespace), contractCodeDomInfo.ClrNamespace)));
1126
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.InvalidClrNameGeneratedForISerializable, classDataContract.XmlName.Name, classDataContract.XmlName.Namespace, contractCodeDomInfo.TypeDeclaration.Name)));
1603
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.CannotComputeUniqueName, nsFragment)));
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (2)
372
throw ExceptionUtil.ThrowHelperError(new
InvalidDataContractException
(SR.Format(SR.AnnotationAttributeNotFound, ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace, ImportGlobals.ActualTypeNameAttribute)));
375
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)
2033
catch (
InvalidDataContractException
)
System\Runtime\Serialization\DataContractSet.cs (1)
370
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)
346
catch (
InvalidDataContractException
)
System.Runtime.Serialization.Xml (1)
artifacts\obj\System.Runtime.Serialization.Xml\Debug\net10.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)