56 references to Format
System.Text.Json (56)
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 (43)
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));
269
throw new InvalidOperationException(SR.
Format
(SR.SerializerPropertyNameConflict, type, propertyName));
275
throw new InvalidOperationException(SR.
Format
(SR.SerializerPropertyNameNull, jsonPropertyInfo.DeclaringType, jsonPropertyInfo.MemberName));
281
throw new InvalidOperationException(SR.
Format
(SR.JsonPropertyRequiredAndNotDeserializable, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType));
287
throw new InvalidOperationException(SR.
Format
(SR.JsonPropertyRequiredAndExtensionData, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType));
323
throw new JsonException(SR.
Format
(SR.JsonRequiredPropertiesMissing, parent.Type, listOfMissingPropertiesBuilder.ToString()));
329
throw new JsonException(SR.
Format
(SR.DuplicatePropertiesNotAllowed_JsonPropertyInfo, property.Name, property.DeclaringType));
409
throw new InvalidOperationException(SR.
Format
(SR.ExtensionDataCannotBindToCtorParam, propertyName, jsonPropertyInfo.DeclaringType));
415
throw new InvalidOperationException(SR.
Format
(SR.JsonIncludeOnInaccessibleProperty, memberName, declaringType));
421
throw new InvalidOperationException(SR.
Format
(SR.IgnoreConditionOnValueTypeInvalid, clrPropertyName, propertyDeclaringType));
428
throw new InvalidOperationException(SR.
Format
(SR.NumberHandlingOnPropertyInvalid, jsonPropertyInfo.MemberName, jsonPropertyInfo.DeclaringType));
567
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateAttribute, attribute, location));
573
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateTypeAttribute, classType, attribute));
579
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateTypeAttribute, classType, typeof(TAttribute)));
585
throw new InvalidOperationException(SR.
Format
(SR.ExtensionDataConflictsWithUnmappedMemberHandling, classType, jsonPropertyInfo.MemberName));
591
throw new InvalidOperationException(SR.
Format
(SR.SerializationDataExtensionPropertyInvalid, jsonPropertyInfo.PropertyType, jsonPropertyInfo.MemberName));
683
message = SR.
Format
(SR.DeserializeNoConstructor, nameof(JsonConstructorAttribute), type);
736
throw new JsonException(SR.
Format
(SR.UnmappedJsonProperty, unmappedPropertyName, type));
799
ThrowJsonException(SR.
Format
(SR.MetadataPreservedArrayFailed,
810
ThrowJsonException(SR.
Format
(SR.MetadataPreservedArrayFailed,
831
throw new InvalidOperationException(SR.
Format
(SR.JsonPropertyInfoBoundToDifferentParent, propertyInfo.Name, propertyInfo.DeclaringTypeInfo.Type.FullName));
855
throw new NotSupportedException(SR.
Format
(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
872
throw new InvalidOperationException(SR.
Format
(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
877
return new InvalidOperationException(SR.
Format
(SR.NoMetadataForTypeProperties, resolver?.ToString() ?? "<null>", type));
907
throw new NotSupportedException(SR.
Format
(SR.Polymorphism_RuntimeTypeNotSupported, runtimeType, baseType));
925
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_DerivedTypeIsNotSupported, derivedType, baseType));
931
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_DerivedTypeIsAlreadySpecified, baseType, derivedType));
937
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_TypeDicriminatorIdIsAlreadySpecified, baseType, typeDiscriminator));
949
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_PropertyConflictsWithMetadataPropertyName, type, propertyName));
961
throw new InvalidOperationException(SR.
Format
(SR.UnsupportedEnumIdentifier, enumType.Name, enumName));