71 instantiations of InvalidDataContractException
dotnet-svcutil-lib (71)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (4)
532
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType))));
541
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType))));
810
(new
InvalidDataContractException
(string.Format(SRSerialization.AttributedTypesCannotInheritFromNonAttributedSerializableTypes,
1401
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.NonAttributedSerializableTypesMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (6)
286
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(dataContract.GetType()), DataContract.GetClrTypeFullName(dataContract.UnderlyingType))));
307
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TypeCannotBeImported, typeName.Name, typeName.Namespace, string.Format(SRSerialization.CircularTypeReference, classContract.StableName.Name, classContract.StableName.Namespace))));
436
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.CannotComputeUniqueName, typeName)));
560
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TypeMustBeIXmlSerializable, DataContract.GetClrTypeFullName(type), DataContract.GetClrTypeFullName(Globals.TypeOfIXmlSerializable), dataContract.StableName.Name, dataContract.StableName.Namespace)));
576
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericTypeNameMismatch, dataContract.StableName.Name, dataContract.StableName.Namespace, genericStableName.Name, genericStableName.Namespace)));
1511
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.CannotComputeUniqueName, nsFragment)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (12)
548
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GetOnlyCollectionMustHaveAddMethod, GetClrTypeFullName(UnderlyingType))));
631
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidCollectionContractItemName, DataContract.GetClrTypeFullName(UnderlyingType))));
638
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidCollectionContractKeyName, DataContract.GetClrTypeFullName(UnderlyingType))));
640
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName)));
646
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidCollectionContractValueName, DataContract.GetClrTypeFullName(UnderlyingType))));
648
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidCollectionContractValueNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.ValueName)));
691
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.CollectionMustHaveGetEnumeratorMethod, DataContract.GetClrTypeFullName(type))));
693
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.CollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(type))));
695
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.CollectionMustHaveItemType, DataContract.GetClrTypeFullName(type))));
1199
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(GetInvalidCollectionMessage(message, string.Format(SRSerialization.InvalidCollectionDataContract, DataContract.GetClrTypeFullName(type)), param)));
1292
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(InvalidCollectionInSharedContractMessage));
1314
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(this.UnderlyingType))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (14)
309
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType))));
314
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType))));
1107
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(message));
1322
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.RecursiveCollectionType, GetClrTypeFullName(itemType))));
1452
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidDataContractName, DataContract.GetClrTypeFullName(type))));
1464
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidDataContractNamespace, DataContract.GetClrTypeFullName(type))));
1543
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TooManyDataContracts, DataContract.GetClrTypeFullName(type))));
1585
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TooManyCollectionContracts, DataContract.GetClrTypeFullName(type))));
1592
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidCollectionContractName, DataContract.GetClrTypeFullName(type))));
1604
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidCollectionContractNamespace, DataContract.GetClrTypeFullName(type))));
1851
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidGlobalDataContractNamespace, clrNs)));
1853
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.DataContractNamespaceAlreadySet, dataContractNs, nsAttribute.ContractNamespace, clrNs)));
2022
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericNameBraceMismatch, format, genericNameProvider.GetGenericTypeName())));
2041
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericParameterNotValid, format.Substring(start, i - start), genericNameProvider.GetGenericTypeName(), genericNameProvider.GetParameterCount() - 1)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (2)
107
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericTypeNotExportable, type)));
265
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.SurrogatesWithGetOnlyCollectionsNotSupported,
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataMemberAttribute.cs (1)
37
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.OrderCannotBeNegative)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
510
throw new
InvalidDataContractException
("Cannot use ExceptionDataContract to serialize object with type: " + type);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaExporter.cs (5)
24
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidXmlDataContractName, DataContract.GetClrTypeFullName(type))));
53
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidGetSchemaMethod, DataContract.GetClrTypeFullName(clrType))));
60
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.MissingGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName)));
63
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidReturnTypeOnGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName, DataContract.GetClrTypeFullName(getMethod.ReturnType), DataContract.GetClrTypeFullName(Globals.TypeOfXmlQualifiedName))));
70
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidNonNullReturnValueByIsAny, DataContract.GetClrTypeFullName(clrType), methodName)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (13)
380
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.CannotComputeUniqueName, element.Name)));
396
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.SpecifiedTypeNotFoundInSchema, typeName.Name, typeName.Namespace)));
1001
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.InvalidEmitDefaultAnnotation, memberName, typeName.Name, typeName.Namespace)));
1036
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.AnnotationAttributeNotFound, SchemaExporter.DefaultValueAnnotation.Name, typeName.Name, typeName.Namespace, Globals.EmitDefaultValueAttribute)));
1049
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace, Globals.ActualTypeNameAttribute)));
1053
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.AnnotationAttributeNotFound, SchemaExporter.ActualTypeAnnotationName.Name, typeName.Name, typeName.Namespace, Globals.ActualTypeNamespaceAttribute)));
1295
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericAnnotationAttributeNotFound, type.Name, Globals.GenericNameAttribute)));
1299
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericAnnotationAttributeNotFound, type.Name, Globals.GenericNamespaceAttribute)));
1312
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericAnnotationHasInvalidElement, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name)));
1318
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericAnnotationHasInvalidAttributeValue, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name, nestedLevelAttribute.Value, nestedLevelAttribute.LocalName, Globals.TypeOfInt.Name)));
1321
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericAnnotationForNestedLevelMustBeIncreasing, argumentElement.LocalName, argumentElement.NamespaceURI, type.Name)));
1332
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.GenericAnnotationHasInvalidAttributeValue, typeElement.LocalName, typeElement.NamespaceURI, type.Name, typeNestedLevelsAttribute.Value, typeNestedLevelsAttribute.LocalName, Globals.TypeOfInt.Name)));
1474
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TypeCannotBeImportedHowToFix, message)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (4)
235
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.IXmlSerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type))));
237
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.IXmlSerializableCannotHaveCollectionDataContract, DataContract.GetClrTypeFullName(type))));
270
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.IsAnyCannotHaveXmlRoot, DataContract.GetClrTypeFullName(UnderlyingType))));
364
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.IXmlSerializableMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerContext.cs (1)
170
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TypeNotSerializable, memberType)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (3)
126
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser, DataContract.GetClrTypeFullName(declaredType))));
179
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TypeNotSerializable, memberType)));
198
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser,
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (2)
222
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.TypeNotSerializable, memberType)));
241
throw /*System.Runtime.Serialization.*/DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(string.Format(SRSerialization.SurrogatesWithGetOnlyCollectionsNotSupportedSerDeser,
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlWriterDelegator.cs (1)
289
return new
InvalidDataContractException
(string.Format(SRSerialization.InvalidPrimitiveType, DataContract.GetClrTypeFullName(type)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\DataContractSerializerOperationGenerator.cs (1)
200
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(String.Format(CultureInfo.InvariantCulture, "Cannot find DataContract attribute for {0}", messageName)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
428
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new
InvalidDataContractException
(
8 references to InvalidDataContractException
dotnet-svcutil-lib (8)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (1)
2155
catch (
InvalidDataContractException
)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (1)
400
catch (
InvalidDataContractException
)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\SchemaImporter.cs (2)
416
InvalidDataContractException
invalidContractException;
497
catch (
InvalidDataContractException
e)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XsdDataContractImporter.cs (1)
275
catch (
InvalidDataContractException
)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MessageContractImporter.cs (1)
1711
catch (
InvalidDataContractException
ex)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\DataContractSerializerOperationFormatter.cs (1)
426
catch (System.Runtime.Serialization.
InvalidDataContractException
e)
Tool.cs (1)
386
else if (ex is DcNS.
InvalidDataContractException
dce)