142 references to Format
System.Private.DataContractSerialization (142)
System\Runtime\Serialization\AccessorBuilder.cs (3)
91
throw new InvalidOperationException(SR.
Format
(SR.InvalidMember, DataContract.GetClrTypeFullName(memberInfo.DeclaringType!), memberInfo.Name));
143
throw new InvalidOperationException(SR.
Format
(SR.NoSetMethodForProperty, propInfo.DeclaringType, propInfo.Name));
155
throw new InvalidOperationException(SR.
Format
(SR.InvalidMember, DataContract.GetClrTypeFullName(memberInfo.DeclaringType!), memberInfo.Name));
System\Runtime\Serialization\ClassDataContract.cs (18)
449
throw new SecurityException(SR.
Format
(
462
throw new SecurityException(SR.
Format
(
481
throw new SecurityException(SR.
Format
(
489
throw new SecurityException(SR.
Format
(
532
throw new SecurityException(SR.
Format
(
545
throw new SecurityException(SR.
Format
(
564
throw new SecurityException(SR.
Format
(
572
throw new SecurityException(SR.
Format
(
658
throw new InvalidDataContractException(SR.
Format
(SR.AttributedTypesCannotInheritFromNonAttributedSerializableTypes,
824
ThrowInvalidDataContractException(SR.
Format
(SR.TooManyDataMembers, DataContract.GetClrTypeFullName(member.DeclaringType!), member.Name));
837
ThrowInvalidDataContractException(SR.
Format
(SR.NoGetMethodForProperty, property.DeclaringType, property.Name));
842
_serializationExceptionMessage = SR.
Format
(SR.NoSetMethodForProperty, property.DeclaringType, property.Name);
846
ThrowInvalidDataContractException(SR.
Format
(SR.IndexedPropertyCannotBeSerialized, property.DeclaringType, property.Name));
849
ThrowInvalidDataContractException(SR.
Format
(SR.InvalidMember, DataContract.GetClrTypeFullName(type), member.Name));
855
ThrowInvalidDataContractException(SR.
Format
(SR.InvalidDataMemberName, member.Name, DataContract.GetClrTypeFullName(type)));
887
ThrowInvalidDataContractException(SR.
Format
(SR.TooManyIgnoreDataMemberAttributes, DataContract.GetClrTypeFullName(member.DeclaringType!), member.Name));
1108
DataContract.ThrowInvalidDataContractException(SR.
Format
(SR.ExtensionDataSetMustReturnVoid, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType);
1131
DataContract.ThrowInvalidDataContractException(SR.
Format
(SR.CallbackMustReturnVoid, DataContract.GetClrTypeFullName(method.DeclaringType), method), method.DeclaringType);
System\Runtime\Serialization\CodeGenerator.cs (4)
590
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.NoGetMethodForProperty, property.DeclaringType, property));
621
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.NoSetMethodForProperty, property.DeclaringType, property));
1172
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source)));
1192
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.IsNotAssignableFrom, DataContract.GetClrTypeFullName(target), DataContract.GetClrTypeFullName(source)));
System\Runtime\Serialization\CollectionDataContract.cs (5)
468
throw new InvalidDataContractException(SR.
Format
(SR.InvalidCollectionContractKeyNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.KeyName));
476
throw new InvalidDataContractException(SR.
Format
(SR.InvalidCollectionContractValueNoDictionary, DataContract.GetClrTypeFullName(UnderlyingType), collectionContractAttribute.ValueName));
614
SR.
Format
(SR.DupKeyValueName, DataContract.GetClrTypeFullName(UnderlyingType), KeyName),
1282
return (param == null) ? SR.Format(message, nestedMessage) : SR.
Format
(message, nestedMessage, param);
1487
throw new SecurityException(SR.
Format
(
System\Runtime\Serialization\DataContract.cs (9)
98
throw new SerializationException(SR.
Format
(SR.ErrorDeserializing, SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), SR.
Format
(SR.NoSetMethodForProperty, string.Empty, string.Empty)));
177
throw new InvalidDataContractException(SR.
Format
(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
184
throw new InvalidDataContractException(SR.
Format
(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
191
throw new InvalidDataContractException(SR.
Format
(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
196
throw new InvalidDataContractException(SR.
Format
(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(GetType()), DataContract.GetClrTypeFullName(UnderlyingType)));
1912
throw new InvalidDataContractException(SR.
Format
(SR.GenericNameBraceMismatch, format, genericNameProvider.GetGenericTypeName()));
2003
DataContract.ThrowInvalidDataContractException(SR.
Format
(SR.KnownTypeAttributeUnknownMethod, methodName, DataContract.GetClrTypeFullName(type)), type);
2006
DataContract.ThrowInvalidDataContractException(SR.
Format
(SR.KnownTypeAttributeReturnType, DataContract.GetClrTypeFullName(type), methodName), type);
System\Runtime\Serialization\DataContractSerializer.cs (2)
408
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.IsAnyCannotBeSerializedAsDerivedType, graphType, contract.UnderlyingType));
482
throw XmlObjectSerializer.CreateSerializationExceptionWithReaderDetails(SR.
Format
(SR.ExpectingElement, expectedNs, expectedName), xmlReader);
System\Runtime\Serialization\DataContractSet.cs (1)
111
throw new InvalidOperationException(SR.
Format
(SR.DupContractInDataContractSet, dataContract.XmlName.Name, dataContract.XmlName.Namespace));
System\Runtime\Serialization\EnumDataContract.cs (7)
233
ThrowInvalidDataContractException(SR.
Format
(SR.TooManyEnumMembers, DataContract.GetClrTypeFullName(field.DeclaringType!), field.Name));
240
ThrowInvalidDataContractException(SR.
Format
(SR.InvalidEnumMemberValue, field.Name, DataContract.GetClrTypeFullName(type)));
252
ThrowInvalidDataContractException(SR.
Format
(SR.DataMemberOnEnumField, DataContract.GetClrTypeFullName(field.DeclaringType!), field.Name));
321
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)));
327
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)));
367
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.InvalidEnumValueOnRead, stringValue, DataContract.GetClrTypeFullName(UnderlyingType)));
386
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType)));
System\Runtime\Serialization\Json\ByteArrayHelperWithString.cs (1)
47
throw new XmlException(SR.
Format
(SR.XmlInvalidConversion, value, type));
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (2)
462
throw XmlObjectSerializer.CreateSerializationExceptionWithReaderDetails(SR.
Format
(SR.ExpectingElement, XmlDictionaryString.Empty, RootName), xmlReader);
642
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
164
throw new SerializationException(SR.
Format
(SR.JsonDuplicateMemberNames, DataContract.GetClrTypeFullName(_traditionalClassDataContract.UnderlyingType), _traditionalClassDataContract.MemberNames[i].Value));
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
351
throw new XmlException(SR.
Format
(SR.JsonExpectedEncoding, GetEncodingName(expEnc), GetEncodingName(actualEnc)));
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (1)
761
SR.
Format
(
System\Runtime\Serialization\Json\JsonObjectDataContract.cs (1)
70
throw new XmlException(SR.
Format
(SR.XmlInvalidConversion, value, Globals.TypeOfInt));
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (2)
266
throw new XmlException(XmlObjectSerializer.TryAddLineInfo(this, SR.
Format
(SR.XmlInvalidConversion, value, "UInt64")));
299
throw new XmlException(XmlObjectSerializer.TryAddLineInfo(this, SR.
Format
(SR.XmlInvalidConversion, value, "UInt64")));
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (1)
181
SR.
Format
(SR.KeyTypeCannotBeParsedInSimpleDictionary,
System\Runtime\Serialization\Json\XmlJsonWriter.cs (5)
823
throw new XmlException(SR.
Format
(SR.JsonInvalidWriteState, "WriteStartDocument", WriteState.ToString()));
868
throw new XmlException(SR.
Format
(SR.JsonInvalidRootElementName, localName, JsonGlobals.rootString));
893
throw new XmlException(SR.
Format
(SR.JsonInvalidItemNameForArrayElement, localName, JsonGlobals.itemString));
918
throw new XmlException(SR.
Format
(SR.JsonInvalidItemNameForArrayElement, localName, JsonGlobals.itemString));
1061
throw new ArgumentException(SR.
Format
(SR.JsonOnlyWhitespace, ws[pos].ToString(), "WriteWhitespace"), nameof(ws));
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (3)
316
SR.
Format
(SR.JsonDuplicateMemberInInput, DataContract.GetClrTypeFullName(obj.GetType()), memberNames[memberIndex]));
336
throw new SerializationException(SR.
Format
(
341
throw new SerializationException(SR.
Format
(
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (3)
325
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.XmlObjectAssignedToIncompatibleInterface, graph.GetType(), declaredType));
330
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.CollectionAssignedToIncompatibleInterface, graph.GetType(), declaredType));
344
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ChangingFullTypeNameNotSupported, serInfo.FullTypeName, DataContract.GetClrTypeFullName(objType)));
System\Runtime\Serialization\PrimitiveDataContract.cs (1)
928
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.XmlForObjectCannotHaveContent, localName, ns), xes);
System\Runtime\Serialization\SchemaExporter.cs (4)
537
throw new InvalidDataContractException(SR.
Format
(SR.MissingSchemaType, typeQName, DataContract.GetClrTypeFullName(clrType)));
634
throw new InvalidDataContractException(SR.
Format
(SR.MissingGetSchemaMethod, DataContract.GetClrTypeFullName(clrType), methodName));
644
throw new InvalidDataContractException(SR.
Format
(SR.InvalidNonNullReturnValueByIsAny, DataContract.GetClrTypeFullName(clrType), methodName));
682
throw new InvalidDataContractException(SR.
Format
(SR.MissingSchemaType, typeName, DataContract.GetClrTypeFullName(clrType)));
System\Runtime\Serialization\SchemaImporter.cs (14)
391
throw new InvalidDataContractException(SR.
Format
(SR.SpecifiedTypeNotFoundInSchema, typeName.Name, typeName.Namespace));
670
ThrowTypeCannotBeImportedException(dataContract.XmlName.Name, dataContract.XmlName.Namespace, SR.
Format
(SR.DerivedTypeNotISerializable, baseTypeName.Name, baseTypeName.Namespace));
815
ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.IsValueTypeFormattedIncorrectly, isValueTypeInnerText, fe.Message));
838
ThrowISerializableTypeCannotBeImportedException(dataContract.XmlName.Name, dataContract.XmlName.Namespace, SR.
Format
(SR.BaseTypeNotISerializable, baseTypeName.Name, baseTypeName.Namespace));
889
ThrowISerializableTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.ISerializableMustRefFactoryTypeAttribute, factoryTypeAttributeRefName.Name, factoryTypeAttributeRefName.Namespace));
903
ThrowTypeCannotBeImportedException(dataContract.XmlName.Name, dataContract.XmlName.Namespace, SR.
Format
(dataContract.IsISerializable ? SR.InvalidISerializableDerivation : SR.InvalidClassDerivation, baseTypeName.Name, baseTypeName.Namespace));
932
ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.AnonymousTypeNotSupported, typeName.Name, typeName.Namespace));
937
ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.TopLevelElementRepresentsDifferentType, topLevelElement.SchemaTypeName.Name, topLevelElement.SchemaTypeName.Namespace));
976
ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.ElementRefOnLocalElementNotSupported, element.RefName.Name, element.RefName.Namespace));
1093
ThrowArrayTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.ElementRefOnLocalElementNotSupported, element.RefName.Name, element.RefName.Namespace));
1113
ThrowArrayTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.InvalidKeyValueTypeNamespace, element.Name, keyValueContract.Namespace));
1162
ThrowTypeCannotBeImportedException(typeName.Name, typeName.Namespace, SR.
Format
(SR.IsDictionaryFormattedIncorrectly, isDictionaryInnerText, fe.Message));
1287
throw new InvalidDataContractException(SR.
Format
(SR.GenericAnnotationAttributeNotFound, type.Name, Globals.GenericNameAttribute));
1290
throw new InvalidDataContractException(SR.
Format
(SR.GenericAnnotationAttributeNotFound, type.Name, Globals.GenericNamespaceAttribute));
System\Runtime\Serialization\XmlObjectSerializer.cs (2)
437
return string.Create(CultureInfo.InvariantCulture, $"{SR.
Format
(SR.ErrorInLine, reader.LineNumber, reader.LinePosition)} {errorMessage}");
460
return SR.
Format
(errorMessage, typeInfo, innerExceptionMessage);
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (6)
64
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ArrayExceededSize, arraySize, DataContract.GetClrTypeFullName(type)));
119
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ErrorDeserializing, SR.Format(SR.ErrorTypeInfo, DataContract.GetClrTypeFullName(declaredType)), SR.Format(SR.XmlStartElementExpected, Globals.RefLocalName)));
180
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.FactoryTypeNotISerializable, DataContract.GetClrTypeFullName(factoryDataContract.UnderlyingType), DataContract.GetClrTypeFullName(dataContract.UnderlyingType)));
456
SR.
Format
(SR.MaxArrayLengthExceeded, int.MaxValue,
840
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ArraySizeAttributeIncorrect, arraySize, 0));
843
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ArraySizeAttributeIncorrect, arraySize, dataNode.Items.Count));
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (4)
461
throw new SerializationException(SR.
Format
(SR.RequiredMemberMustBeEmitted, memberName, type.FullName));
605
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ResolveTypeReturnedFalse, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)));
615
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)));
620
throw XmlObjectSerializer.CreateSerializationException(SR.
Format
(SR.ResolveTypeReturnedNull, DataContract.GetClrTypeFullName(DataContractResolver.GetType()), DataContract.GetClrTypeFullName(objectType)));
System\Runtime\Serialization\XmlReaderDelegator.cs (1)
338
throw new XmlException(XmlObjectSerializer.TryAddLineInfo(this, SR.
Format
(SR.XmlInvalidConversion, value, type)));
System\Text\Base64Encoding.cs (7)
80
throw new FormatException(SR.
Format
(SR.XmlInvalidBase64Sequence, new string(pch, 0, 4), index + (int)(pch - _chars)));
90
throw new FormatException(SR.
Format
(SR.XmlInvalidBase64Sequence, new string(pch, 0, 4), index + (int)(pch - _chars)));
140
throw new FormatException(SR.
Format
(SR.XmlInvalidBase64Sequence, new string(pch, 0, 4), charIndex + (int)(pch - _chars)));
150
throw new FormatException(SR.
Format
(SR.XmlInvalidBase64Sequence, new string(pch, 0, 4), charIndex + (int)(pch - _chars)));
212
throw new FormatException(SR.
Format
(SR.XmlInvalidBase64Sequence, "?", charIndex + (int)(pch - _chars)));
222
throw new FormatException(SR.
Format
(SR.XmlInvalidBase64Sequence, "?", charIndex + (int)(pch - _chars)));
248
throw new ArgumentOutOfRangeException(nameof(byteCount), SR.
Format
(SR.ValueMustBeInRange, 0, int.MaxValue / 4 * 3 - 2));
System\Text\BinHexEncoding.cs (2)
45
throw new FormatException(SR.
Format
(SR.XmlInvalidBinHexSequence, new string(chars, error, 2), error));
54
throw new ArgumentOutOfRangeException(nameof(byteCount), SR.
Format
(SR.ValueMustBeInRange, 0, int.MaxValue / 2));
System\Xml\EncodingStreamWrapper.cs (2)
499
throw new XmlException(SR.
Format
(SR.XmlExpectedEncoding, GetEncodingName(expEnc), GetEncodingName(actualEnc)));
509
throw new XmlException(SR.
Format
(SR.XmlEncodingMismatch, declEnc, docEnc));
System\Xml\XmlBaseReader.cs (2)
349
XmlExceptionHelper.ThrowXmlException(this, new XmlException(SR.
Format
(SR.XmlSpecificBindingPrefix, "xml", xmlNamespace)));
353
XmlExceptionHelper.ThrowXmlException(this, new XmlException(SR.
Format
(SR.XmlSpecificBindingPrefix, "xmlns", xmlnsNamespace)));
System\Xml\XmlBaseWriter.cs (21)
155
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteXmlnsAttribute", WriteState.ToString()));
179
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteXmlnsAttribute", WriteState.ToString()));
207
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteStartAttribute", WriteState.ToString()));
272
throw new ArgumentException(SR.
Format
(SR.XmlSpecificBindingNamespace, "xmlns", ns));
274
throw new ArgumentException(SR.
Format
(SR.XmlSpecificBindingNamespace, "xml", ns));
311
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteEndAttribute", WriteState.ToString()));
370
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteEndAttribute", WriteState.ToString()));
434
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteComment", WriteState.ToString()));
460
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteFullEndElement", WriteState.ToString()));
472
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteCData", WriteState.ToString()));
501
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteStartElement", WriteState.ToString()));
542
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteStartElement", WriteState.ToString()));
609
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidDepth, "WriteEndElement", _depth.ToString(CultureInfo.InvariantCulture)));
636
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidDepth, "WriteEndElement", _depth.ToString(CultureInfo.InvariantCulture)));
869
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteStartDocument", WriteState.ToString()));
1632
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "StartFragment", WriteState.ToString()));
1684
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "EndFragment", WriteState.ToString()));
1719
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteFragment", WriteState.ToString()));
1821
throw new InvalidOperationException(SR.
Format
(SR.XmlInvalidWriteState, "WriteStartElement", WriteState.ToString()));
2169
throw new ArgumentException(SR.
Format
(SR.XmlSpecificBindingNamespace, "xmlns", uri));
2172
throw new ArgumentException(SR.
Format
(SR.XmlSpecificBindingNamespace, "xml", uri));
System\Xml\XmlDictionaryString.cs (1)
30
throw new ArgumentOutOfRangeException(nameof(key), SR.
Format
(SR.ValueMustBeInRange, MinKey, MaxKey));
System\Xml\XmlExceptionHelper.cs (5)
36
s += " " + SR.
Format
(SR.XmlLineInfo, lineInfo.LineNumber, lineInfo.LinePosition);
48
s += " " + SR.
Format
(SR.XmlLineInfo, lineInfo.LineNumber, lineInfo.LinePosition);
68
return SR.
Format
(SR.XmlFoundElement, GetName(reader.Prefix, reader.LocalName), reader.NamespaceURI);
70
return SR.
Format
(SR.XmlFoundEndElement, GetName(reader.Prefix, reader.LocalName), reader.NamespaceURI);
311
return new XmlException(SR.
Format
(SR.XmlInvalidConversion, value, type), exception);