61 references to Format
System.Text.Json (61)
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (3)
126
throw new InvalidOperationException(SR.
Format
(SR.FSharpUnionDuplicateCaseName, typeof(T), discriminatorName));
131
throw new InvalidOperationException(SR.
Format
(SR.FSharpUnionDuplicateCaseName, typeof(T), discriminatorName));
283
throw new JsonException(SR.
Format
(SR.FSharpUnionMissingDiscriminatorProperty, _typeDiscriminatorPropertyName, typeof(T)));
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (1)
327
throw new InvalidOperationException(SR.
Format
(SR.SerializationConverterNotCompatible, typedConverter, typeof(T)));
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (1)
42
throw new InvalidOperationException(SR.
Format
(SR.FieldCannotBeVirtual, nameof(propertyInfo.IsProperty), nameof(propertyInfo.IsVirtual)));
System\Text\Json\ThrowHelper.cs (9)
31
throw GetArgumentOutOfRangeException(parameterName, SR.
Format
(SR.InvalidIndentSize, minimumSize, maximumSize));
201
ThrowInvalidOperationException(SR.
Format
(SR.DepthTooLarge, currentDepth, maxDepth));
215
ThrowInvalidOperationException(SR.
Format
(SR.DepthTooLarge, currentDepth, maxDepth));
254
ThrowInvalidOperationException(SR.
Format
(SR.DepthTooLarge, currentDepth, maxDepth));
319
throw GetInvalidOperationException(SR.
Format
(SR.CannotMixEncodings, GetEncodingName(previousEncoding), GetEncodingName(currentEncoding)));
337
return GetInvalidOperationException(SR.
Format
(SR.InvalidCast, tokenType, message));
358
SR.
Format
(SR.JsonElementHasWrongType, expectedType, actualType));
366
SR.
Format
(SR.JsonElementHasWrongType, expectedTypeName, actualType));
621
message = SR.
Format
(SR.DepthTooLarge, currentDepth & JsonConstants.RemoveFlagsBitMask, maxDepth);
System\Text\Json\ThrowHelper.Node.cs (2)
77
throw new InvalidOperationException(SR.
Format
(SR.NodeUnableToConvert, sourceType, destinationType));
83
throw new InvalidOperationException(SR.
Format
(SR.NodeUnableToConvertElement, valueKind, destinationType));
System\Text\Json\ThrowHelper.Serialization.cs (45)
22
throw new ArgumentException(SR.
Format
(SR.DeserializeWrongType, type, value.GetType()));
46
throw new NotSupportedException(SR.
Format
(SR.DictionaryKeyTypeNotSupported, keyType, converter.GetType()));
58
throw new InvalidCastException(SR.
Format
(SR.DeserializeUnableToAssignValue, typeOfValue, declaredType));
70
throw new JsonException(SR.
Format
(SR.PropertyGetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true };
76
throw new JsonException(SR.
Format
(SR.PropertySetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true };
82
throw new JsonException(SR.
Format
(SR.ConstructorParameterDisallowNull, parameterName, declaringType)) { AppendPathInformation = true };
88
throw new InvalidOperationException(SR.
Format
(SR.ObjectCreationHandlingPopulateNotSupportedByConverter, propertyInfo.Name, propertyInfo.DeclaringType));
94
throw new InvalidOperationException(SR.
Format
(SR.ObjectCreationHandlingPropertyMustHaveAGetter, propertyInfo.Name, propertyInfo.DeclaringType));
100
throw new InvalidOperationException(SR.
Format
(SR.ObjectCreationHandlingPropertyValueTypeMustHaveASetter, propertyInfo.Name, propertyInfo.DeclaringType));
106
throw new InvalidOperationException(SR.
Format
(SR.ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization, propertyInfo.Name, propertyInfo.DeclaringType));
112
throw new InvalidOperationException(SR.
Format
(SR.ObjectCreationHandlingPropertyCannotAllowReadOnlyMember, propertyInfo.Name, propertyInfo.DeclaringType));
180
throw new InvalidOperationException(SR.
Format
(SR.SerializationConverterNotCompatible, converterType, type));
186
throw new InvalidOperationException(SR.
Format
(SR.ResolverTypeNotCompatible, actualType, requestedType));
229
throw new InvalidOperationException(SR.
Format
(SR.SerializationConverterOnAttributeNotCompatible, location, typeToConvert));
241
throw new InvalidOperationException(SR.
Format
(SR.SerializationConverterOnAttributeOpenGenericNotCompatible, location, converterType));
281
throw new InvalidOperationException(SR.
Format
(SR.SerializerPropertyNameConflict, type, propertyName));
287
throw new InvalidOperationException(SR.
Format
(SR.SerializerPropertyNameNull, jsonPropertyInfo.DeclaringType, jsonPropertyInfo.MemberName));
293
throw new InvalidOperationException(SR.
Format
(SR.JsonPropertyRequiredAndNotDeserializable, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType));
299
throw new InvalidOperationException(SR.
Format
(SR.JsonPropertyRequiredAndExtensionData, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType));
318
throw new JsonException(SR.
Format
(SR.JsonRequiredPropertiesMissing, parent.Type, builder.ToString()));
324
throw new JsonException(SR.
Format
(SR.JsonRequiredPropertiesMissing, type, propertyList));
351
throw new JsonException(SR.
Format
(SR.DuplicatePropertiesNotAllowed_JsonPropertyInfo, property.Name, property.DeclaringType));
431
throw new InvalidOperationException(SR.
Format
(SR.ExtensionDataCannotBindToCtorParam, propertyName, jsonPropertyInfo.DeclaringType));
437
throw new InvalidOperationException(SR.
Format
(SR.JsonIncludeOnInaccessibleProperty, memberName, declaringType));
443
throw new InvalidOperationException(SR.
Format
(SR.IgnoreConditionOnValueTypeInvalid, clrPropertyName, propertyDeclaringType));
450
throw new InvalidOperationException(SR.
Format
(SR.NumberHandlingOnPropertyInvalid, jsonPropertyInfo.MemberName, jsonPropertyInfo.DeclaringType));
589
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateAttribute, attribute, location));
595
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateTypeAttribute, classType, attribute));
601
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateTypeAttribute, classType, typeof(TAttribute)));
607
throw new InvalidOperationException(SR.
Format
(SR.ExtensionDataConflictsWithUnmappedMemberHandling, classType, jsonPropertyInfo.MemberName));
613
throw new InvalidOperationException(SR.
Format
(SR.SerializationDataExtensionPropertyInvalid, jsonPropertyInfo.PropertyType, jsonPropertyInfo.MemberName));
705
message = SR.
Format
(SR.DeserializeNoConstructor, nameof(JsonConstructorAttribute), type);
758
throw new JsonException(SR.
Format
(SR.UnmappedJsonProperty, unmappedPropertyName, type));
821
ThrowJsonException(SR.
Format
(SR.MetadataPreservedArrayFailed,
832
ThrowJsonException(SR.
Format
(SR.MetadataPreservedArrayFailed,
853
throw new InvalidOperationException(SR.
Format
(SR.JsonPropertyInfoBoundToDifferentParent, propertyInfo.Name, propertyInfo.DeclaringTypeInfo.Type.FullName));
877
throw new NotSupportedException(SR.
Format
(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
894
throw new InvalidOperationException(SR.
Format
(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
899
return new InvalidOperationException(SR.
Format
(SR.NoMetadataForTypeProperties, resolver?.ToString() ?? "<null>", type));
929
throw new NotSupportedException(SR.
Format
(SR.Polymorphism_RuntimeTypeNotSupported, runtimeType, baseType));
947
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_DerivedTypeIsNotSupported, derivedType, baseType));
953
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_DerivedTypeIsAlreadySpecified, baseType, derivedType));
959
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_TypeDicriminatorIdIsAlreadySpecified, baseType, typeDiscriminator));
971
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_PropertyConflictsWithMetadataPropertyName, type, propertyName));
983
throw new InvalidOperationException(SR.
Format
(SR.UnsupportedEnumIdentifier, enumType.Name, enumName));