55 references to Format
System.Text.Json (55)
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 (42)
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()));
369
throw new InvalidOperationException(SR.
Format
(SR.ExtensionDataCannotBindToCtorParam, propertyName, jsonPropertyInfo.DeclaringType));
375
throw new InvalidOperationException(SR.
Format
(SR.JsonIncludeOnInaccessibleProperty, memberName, declaringType));
381
throw new InvalidOperationException(SR.
Format
(SR.IgnoreConditionOnValueTypeInvalid, clrPropertyName, propertyDeclaringType));
388
throw new InvalidOperationException(SR.
Format
(SR.NumberHandlingOnPropertyInvalid, jsonPropertyInfo.MemberName, jsonPropertyInfo.DeclaringType));
527
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateAttribute, attribute, location));
533
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateTypeAttribute, classType, attribute));
539
throw new InvalidOperationException(SR.
Format
(SR.SerializationDuplicateTypeAttribute, classType, typeof(TAttribute)));
545
throw new InvalidOperationException(SR.
Format
(SR.ExtensionDataConflictsWithUnmappedMemberHandling, classType, jsonPropertyInfo.MemberName));
551
throw new InvalidOperationException(SR.
Format
(SR.SerializationDataExtensionPropertyInvalid, jsonPropertyInfo.PropertyType, jsonPropertyInfo.MemberName));
643
message = SR.
Format
(SR.DeserializeNoConstructor, nameof(JsonConstructorAttribute), type);
696
throw new JsonException(SR.
Format
(SR.UnmappedJsonProperty, unmappedPropertyName, type));
759
ThrowJsonException(SR.
Format
(SR.MetadataPreservedArrayFailed,
770
ThrowJsonException(SR.
Format
(SR.MetadataPreservedArrayFailed,
791
throw new InvalidOperationException(SR.
Format
(SR.JsonPropertyInfoBoundToDifferentParent, propertyInfo.Name, propertyInfo.DeclaringTypeInfo.Type.FullName));
815
throw new NotSupportedException(SR.
Format
(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
832
throw new InvalidOperationException(SR.
Format
(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
837
return new InvalidOperationException(SR.
Format
(SR.NoMetadataForTypeProperties, resolver?.ToString() ?? "<null>", type));
867
throw new NotSupportedException(SR.
Format
(SR.Polymorphism_RuntimeTypeNotSupported, runtimeType, baseType));
885
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_DerivedTypeIsNotSupported, derivedType, baseType));
891
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_DerivedTypeIsAlreadySpecified, baseType, derivedType));
897
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_TypeDicriminatorIdIsAlreadySpecified, baseType, typeDiscriminator));
909
throw new InvalidOperationException(SR.
Format
(SR.Polymorphism_PropertyConflictsWithMetadataPropertyName, type, propertyName));
921
throw new InvalidOperationException(SR.
Format
(SR.UnsupportedEnumIdentifier, enumType.Name, enumName));