460 references to SR
System.Text.Json (460)
System\Text\Json\Document\JsonDocument.cs (1)
1140
throw new ArgumentException(
SR
.JsonDocumentDoesNotSupportComments, paramName);
System\Text\Json\Document\JsonDocumentOptions.cs (1)
34
throw new ArgumentOutOfRangeException(nameof(value),
SR
.JsonDocumentDoesNotSupportComments);
System\Text\Json\Document\JsonElement.cs (6)
143
throw new KeyNotFoundException(
SR
.Format(
SR
.Arg_KeyNotFoundWithKey, propertyName));
181
throw new KeyNotFoundException(
SR
.Format(
SR
.Arg_KeyNotFoundWithKey, propertyName.ToString()));
221
throw new KeyNotFoundException(
SR
.Format(
SR
.Arg_KeyNotFoundWithKey, Encoding.UTF8.GetString(utf8PropertyName)));
System\Text\Json\Nodes\JsonArray.cs (2)
199
_ => throw new InvalidOperationException(
SR
.Format(
SR
.NodeElementWrongType, nameof(JsonValueKind.Array))),
System\Text\Json\Nodes\JsonNode.cs (2)
200
throw new InvalidOperationException(
SR
.Format(
SR
.NodeWrongType, nameof(JsonValue)));
System\Text\Json\Nodes\JsonObject.cs (2)
65
_ => throw new InvalidOperationException(
SR
.Format(
SR
.NodeElementWrongType, nameof(JsonValueKind.Object)))
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (10)
90
throw new InvalidOperationException(
SR
.Format(
SR
.FSharpUnionFieldConflictsWithDiscriminator, typeof(T), fields[i].FieldName, typeDiscriminatorPropertyName));
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)));
503
throw new InvalidOperationException(
SR
.Format(
SR
.FSharpUnionDuplicateFieldName, declaringType, caseName, fields[i].FieldName));
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverter.cs (2)
15
public string ErrorMessage => _errorMessage ??
SR
.Format(
SR
.SerializeTypeInstanceNotSupported, typeof(T).FullName);
System\Text\Json\Serialization\JsonSerializerOptions.cs (5)
340
throw new ArgumentException(
SR
.SerializationInvalidBufferSize);
406
throw new InvalidOperationException(
SR
.DefaultIgnoreConditionAlreadySpecified);
436
throw new ArgumentException(
SR
.DefaultIgnoreConditionInvalid);
441
throw new InvalidOperationException(
SR
.DefaultIgnoreConditionAlreadySpecified);
659
throw new ArgumentOutOfRangeException(nameof(value),
SR
.JsonSerializerDoesNotSupportComments);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
113
ThrowHelper.ThrowInvalidOperationException(
SR
.DefaultIgnoreConditionInvalid);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (2)
327
throw new InvalidOperationException(
SR
.Format(
SR
.SerializationConverterNotCompatible, typedConverter, typeof(T)));
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (2)
42
throw new InvalidOperationException(
SR
.Format(
SR
.FieldCannotBeVirtual, nameof(propertyInfo.IsProperty), nameof(propertyInfo.IsVirtual)));
System\Text\Json\ThrowHelper.cs (168)
19
throw GetArgumentOutOfRangeException(parameterName,
SR
.InvalidNewLine);
25
throw GetArgumentOutOfRangeException(parameterName,
SR
.InvalidIndentCharacter);
31
throw GetArgumentOutOfRangeException(parameterName,
SR
.Format(
SR
.InvalidIndentSize, minimumSize, maximumSize));
37
throw GetArgumentOutOfRangeException(parameterName,
SR
.MaxDepthMustBePositive);
43
throw GetArgumentOutOfRangeException(parameterName,
SR
.JsonNumberExponentTooLarge);
54
throw GetArgumentOutOfRangeException(parameterName,
SR
.CommentHandlingMustBeValid);
60
throw new ArgumentOutOfRangeException(paramName,
SR
.ArrayIndexNegative);
66
throw new ArgumentOutOfRangeException(nameof(typeToConvert),
SR
.Format(
SR
.SerializerConverterFactoryInvalidArgument, typeToConvert.FullName));
72
throw new ArgumentOutOfRangeException(paramName,
SR
.ArgumentOutOfRange_Generic_MustBeNonNegative);
78
throw new ArgumentException(
SR
.Argument_InvalidOffLen);
84
throw new ArgumentException(
SR
.ArrayTooSmall, paramName);
100
return GetInvalidOperationException(
SR
.Format(
SR
.CallFlushToAvoidDataLoss, _buffered));
106
throw GetArgumentException(
SR
.DestinationTooShort);
112
throw GetArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, tokenLength));
118
throw GetArgumentException(
SR
.Format(
SR
.ValueTooLarge, tokenLength));
124
throw GetArgumentException(
SR
.SpecialNumberValuesNotSupported);
130
throw GetInvalidOperationException(
SR
.FailedToGetLargerSpan);
136
throw GetArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, length));
144
ThrowArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, propertyName.Length));
149
ThrowArgumentException(
SR
.Format(
SR
.ValueTooLarge, value.Length));
158
ThrowArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, propertyName.Length));
163
ThrowArgumentException(
SR
.Format(
SR
.ValueTooLarge, value.Length));
172
ThrowArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, propertyName.Length));
177
ThrowArgumentException(
SR
.Format(
SR
.ValueTooLarge, value.Length));
186
ThrowArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, propertyName.Length));
191
ThrowArgumentException(
SR
.Format(
SR
.ValueTooLarge, value.Length));
201
ThrowInvalidOperationException(
SR
.Format(
SR
.DepthTooLarge, currentDepth, maxDepth));
206
ThrowArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, propertyName.Length));
215
ThrowInvalidOperationException(
SR
.Format(
SR
.DepthTooLarge, currentDepth, maxDepth));
240
return GetInvalidOperationException(
SR
.ZeroDepthAtEnd);
244
return GetInvalidOperationException(
SR
.EmptyJsonIsInvalid);
254
ThrowInvalidOperationException(
SR
.Format(
SR
.DepthTooLarge, currentDepth, maxDepth));
259
ThrowArgumentException(
SR
.Format(
SR
.PropertyNameTooLarge, propertyName.Length));
312
throw GetInvalidOperationException(
SR
.CannotSkip);
319
throw GetInvalidOperationException(
SR
.Format(
SR
.CannotMixEncodings, GetEncodingName(previousEncoding), GetEncodingName(currentEncoding)));
337
return GetInvalidOperationException(
SR
.Format(
SR
.InvalidCast, tokenType, message));
342
return GetInvalidOperationException(
SR
.Format(
SR
.InvalidComparison, tokenType));
358
SR
.Format(
SR
.JsonElementHasWrongType, expectedType, actualType));
366
SR
.Format(
SR
.JsonElementHasWrongType, expectedTypeName, actualType));
405
message =
SR
.Format(
SR
.ArrayDepthTooLarge, json.CurrentState.Options.MaxDepth);
408
message =
SR
.Format(
SR
.MismatchedObjectArray, character);
411
message =
SR
.TrailingCommaNotAllowedBeforeArrayEnd;
414
message =
SR
.TrailingCommaNotAllowedBeforeObjectEnd;
417
message =
SR
.EndOfStringNotFound;
420
message =
SR
.Format(
SR
.RequiredDigitNotFoundAfterSign, character);
423
message =
SR
.Format(
SR
.RequiredDigitNotFoundAfterDecimal, character);
426
message =
SR
.RequiredDigitNotFoundEndOfData;
429
message =
SR
.Format(
SR
.ExpectedEndAfterSingleJson, character);
432
message =
SR
.Format(
SR
.ExpectedEndOfDigitNotFound, character);
435
message =
SR
.Format(
SR
.ExpectedNextDigitEValueNotFound, character);
438
message =
SR
.Format(
SR
.ExpectedSeparatorAfterPropertyNameNotFound, character);
441
message =
SR
.Format(
SR
.ExpectedStartOfPropertyNotFound, character);
444
message =
SR
.ExpectedStartOfPropertyOrValueNotFound;
447
message =
SR
.Format(
SR
.ExpectedStartOfPropertyOrValueAfterComment, character);
450
message =
SR
.Format(
SR
.ExpectedStartOfValueNotFound, character);
453
message =
SR
.ExpectedValueAfterPropertyNameNotFound;
456
message =
SR
.Format(
SR
.FoundInvalidCharacter, character);
459
message =
SR
.Format(
SR
.InvalidEndOfJsonNonPrimitive, json.TokenType);
462
message =
SR
.Format(
SR
.ObjectDepthTooLarge, json.CurrentState.Options.MaxDepth);
465
message =
SR
.Format(
SR
.ExpectedFalse, characters);
468
message =
SR
.Format(
SR
.ExpectedNull, characters);
471
message =
SR
.Format(
SR
.ExpectedTrue, characters);
474
message =
SR
.Format(
SR
.InvalidCharacterWithinString, character);
477
message =
SR
.Format(
SR
.InvalidCharacterAfterEscapeWithinString, character);
480
message =
SR
.Format(
SR
.InvalidHexCharacterWithinString, character);
483
message =
SR
.EndOfCommentNotFound;
486
message =
SR
.ZeroDepthAtEnd;
489
message =
SR
.ExpectedJsonTokens;
492
message =
SR
.NotEnoughData;
495
message =
SR
.ExpectedOneCompleteToken;
498
message =
SR
.Format(
SR
.InvalidCharacterAtStartOfComment, character);
501
message =
SR
.UnexpectedEndOfDataWhileReadingComment;
504
message =
SR
.UnexpectedEndOfLineSeparator;
507
message =
SR
.Format(
SR
.InvalidLeadingZeroInNumber, character);
526
throw new ArgumentException(
SR
.CannotWriteCommentWithEmbeddedDelimiter);
554
throw new ArgumentException(
SR
.Format(
SR
.CannotEncodeInvalidUTF8, builder));
560
throw new ArgumentException(
SR
.Format(
SR
.CannotEncodeInvalidUTF16, $"0x{charAsInt:X2}"));
566
throw GetInvalidOperationException(
SR
.Format(
SR
.CannotReadInvalidUTF16, $"0x{charAsInt:X2}"));
572
throw GetInvalidOperationException(
SR
.CannotReadIncompleteUTF16);
577
return GetInvalidOperationException(
SR
.CannotTranscodeInvalidUtf8, innerException);
582
return new ArgumentException(
SR
.CannotTranscodeInvalidUtf16, innerException);
604
throw new OutOfMemoryException(
SR
.Format(
SR
.BufferMaximumSizeExceeded, capacity));
617
SR
.Format(
SR
.CannotWriteEndAfterProperty, (char)token) :
618
SR
.Format(
SR
.MismatchedObjectArray, (char)token);
621
message =
SR
.Format(
SR
.DepthTooLarge, currentDepth & JsonConstants.RemoveFlagsBitMask, maxDepth);
624
message =
SR
.Format(
SR
.CannotStartObjectArrayWithoutProperty, tokenType);
627
message =
SR
.Format(
SR
.CannotStartObjectArrayAfterPrimitiveOrClose, tokenType);
630
message =
SR
.Format(
SR
.CannotWriteValueWithinObject, tokenType);
634
SR
.CannotWritePropertyAfterProperty :
635
SR
.Format(
SR
.CannotWritePropertyWithinArray, tokenType);
638
message =
SR
.Format(
SR
.CannotWriteValueAfterPrimitiveOrClose, tokenType);
641
message =
SR
.CannotWriteWithinString;
664
message =
SR
.FormatByte;
667
message =
SR
.FormatSByte;
670
message =
SR
.FormatInt16;
673
message =
SR
.FormatInt32;
676
message =
SR
.FormatInt64;
679
message =
SR
.FormatInt128;
682
message =
SR
.FormatUInt16;
685
message =
SR
.FormatUInt32;
688
message =
SR
.FormatUInt64;
691
message =
SR
.FormatUInt128;
694
message =
SR
.FormatHalf;
697
message =
SR
.FormatSingle;
700
message =
SR
.FormatDouble;
703
message =
SR
.FormatDecimal;
728
message =
SR
.Format(
SR
.UnsupportedFormat, dataType);
731
message =
SR
.CannotDecodeInvalidBase64;
762
throw new InsufficientExecutionStackException(
SR
.JsonElementDeepEqualsInsufficientExecutionStack);
System\Text\Json\ThrowHelper.Node.cs (15)
16
throw new ArgumentException(
SR
.NodeValueNotAllowed, paramName);
22
throw new ArgumentException(
SR
.Format(
SR
.NodeDuplicateKey, propertyName), paramName);
34
throw new InvalidOperationException(
SR
.NodeAlreadyHasParent);
40
throw new InvalidOperationException(
SR
.NodeCycleDetected);
46
throw new InvalidOperationException(
SR
.NodeElementCannotBeObjectOrArray);
60
throw new InvalidOperationException(
SR
.Format(
SR
.NodeWrongType, concatenatedNames));
66
throw new InvalidOperationException(
SR
.Format(
SR
.NodeParentWrongType, typeName));
71
return new NotSupportedException(
SR
.CollectionIsReadOnly);
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 (225)
22
throw new ArgumentException(
SR
.Format(
SR
.DeserializeWrongType, type, value.GetType()));
28
throw new ArgumentException(
SR
.JsonSerializerDoesNotSupportComments, paramName);
34
throw new NotSupportedException(
SR
.Format(
SR
.SerializationNotSupportedType, propertyType));
40
throw new NotSupportedException(
SR
.Format(
SR
.TypeRequiresAsyncSerialization, propertyType));
46
throw new NotSupportedException(
SR
.Format(
SR
.DictionaryKeyTypeNotSupported, keyType, converter.GetType()));
52
throw new JsonException(
SR
.Format(
SR
.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true };
58
throw new InvalidCastException(
SR
.Format(
SR
.DeserializeUnableToAssignValue, typeOfValue, declaredType));
64
throw new InvalidOperationException(
SR
.Format(
SR
.DeserializeUnableToAssignNull, 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));
118
throw new InvalidOperationException(
SR
.ObjectCreationHandlingPropertyCannotAllowReferenceHandling);
124
throw new NotSupportedException(
SR
.ObjectCreationHandlingPropertyDoesNotSupportParameterizedConstructors);
130
throw new JsonException(
SR
.Format(
SR
.SerializationConverterRead, converter)) { AppendPathInformation = true };
136
throw new JsonException(
SR
.Format(
SR
.SerializationConverterWrite, converter)) { AppendPathInformation = true };
142
throw new JsonException(
SR
.Format(
SR
.SerializerCycleDetected, maxDepth)) { AppendPathInformation = true };
157
throw new ArgumentException(
SR
.Format(
SR
.CannotSerializeInvalidType, typeToConvert), paramName);
161
throw new ArgumentException(
SR
.Format(
SR
.CannotSerializeInvalidMember, typeToConvert, propertyName, declaringType), paramName);
170
throw new InvalidOperationException(
SR
.Format(
SR
.CannotSerializeInvalidType, typeToConvert));
174
throw new InvalidOperationException(
SR
.Format(
SR
.CannotSerializeInvalidMember, typeToConvert, memberInfo.Name, declaringType));
180
throw new InvalidOperationException(
SR
.Format(
SR
.SerializationConverterNotCompatible, converterType, type));
186
throw new InvalidOperationException(
SR
.Format(
SR
.ResolverTypeNotCompatible, actualType, requestedType));
192
throw new InvalidOperationException(
SR
.ResolverTypeInfoOptionsNotCompatible);
198
throw new InvalidOperationException(
SR
.JsonSerializerOptionsNoTypeInfoResolverSpecified);
204
throw new InvalidOperationException(
SR
.JsonSerializerIsReflectionDisabled);
216
throw new InvalidOperationException(
SR
.Format(
SR
.SerializationConverterOnAttributeInvalid, location));
229
throw new InvalidOperationException(
SR
.Format(
SR
.SerializationConverterOnAttributeNotCompatible, location, typeToConvert));
241
throw new InvalidOperationException(
SR
.Format(
SR
.SerializationConverterOnAttributeOpenGenericNotCompatible, location, converterType));
248
?
SR
.SerializerOptionsReadOnly
249
:
SR
.SerializerContextOptionsReadOnly;
257
throw new InvalidOperationException(
SR
.DefaultTypeInfoResolverImmutable);
263
throw new InvalidOperationException(
SR
.TypeInfoResolverChainImmutable);
269
throw new InvalidOperationException(
SR
.TypeInfoImmutable);
275
throw new InvalidOperationException(
SR
.SerializerOptions_InvalidChainedResolver);
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));
357
throw new JsonException(
SR
.DuplicatePropertiesNotAllowed);
363
throw new JsonException(
SR
.Format(
SR
.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name)));
370
throw new JsonException(
SR
.Format(
SR
.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name)));
391
throw new InvalidOperationException(
SR
.Format(
SR
.NamingPolicyReturnNull, namingPolicy));
397
throw new InvalidOperationException(
SR
.Format(
SR
.SerializerConverterFactoryReturnsNull, converterType));
403
throw new InvalidOperationException(
SR
.Format(
SR
.SerializerConverterFactoryReturnsJsonConverterFactory, converterType));
414
SR
.Format(
415
SR
.MultipleMembersBindWithConstructorParameter,
425
throw new InvalidOperationException(
SR
.Format(
SR
.ConstructorParamIncompleteBinding, parentType));
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));
456
throw new InvalidOperationException(
SR
.Format(
SR
.ConverterCanConvertMultipleTypes, jsonConverter.GetType(), jsonConverter.Type, runtimePropertyType));
469
SR
.Format(
SR
.ObjectWithParameterizedCtorRefMetadataNotSupported, jsonTypeInfo.Type));
476
throw new InvalidOperationException(
SR
.Format(
SR
.InvalidJsonTypeInfoOperationForKind, kind));
482
throw new InvalidOperationException(
SR
.Format(
SR
.OnDeserializingCallbacksNotSupported, type));
488
throw new InvalidOperationException(
SR
.Format(
SR
.CreateObjectConverterNotCompatible, type));
544
message =
SR
.Format(
SR
.DeserializeUnableToConvertValue, propertyType);
574
message =
SR
.SerializeUnableToSerialize;
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));
619
throw new InvalidOperationException(
SR
.Format(
SR
.PropertyTypeNotNullable, jsonPropertyInfo.PropertyType));
625
throw new InvalidOperationException(
SR
.NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty);
646
message +=
SR
.Format(
SR
.SerializationNotSupportedParentType, propertyType);
674
message +=
SR
.Format(
SR
.SerializationNotSupportedParentType, propertyType);
692
message =
SR
.Format(
SR
.DeserializationMustSpecifyTypeDiscriminator, type);
696
message =
SR
.Format(
SR
.CannotPopulateCollection, type);
700
message =
SR
.Format(
SR
.DeserializeInterfaceOrAbstractType, type);
705
message =
SR
.Format(
SR
.DeserializeNoConstructor, nameof(JsonConstructorAttribute), type);
714
ThrowNotSupportedException(ref state, reader, new NotSupportedException(
SR
.Format(
SR
.CannotPopulateCollection, type)));
720
ThrowJsonException(
SR
.Format(
SR
.MetadataInvalidTokenAfterValues, tokenType));
726
ThrowJsonException(
SR
.Format(
SR
.MetadataReferenceNotFound, id));
732
ThrowJsonException(
SR
.Format(
SR
.MetadataValueWasNotString, tokenType));
738
ThrowJsonException(
SR
.Format(
SR
.MetadataValueWasNotString, valueKind));
752
ThrowJsonException(
SR
.MetadataUnexpectedProperty);
758
throw new JsonException(
SR
.Format(
SR
.UnmappedJsonProperty, unmappedPropertyName, type));
764
ThrowJsonException(
SR
.MetadataReferenceCannotContainOtherProperties);
771
ThrowJsonException(
SR
.MetadataIdCannotBeCombinedWithRef);
778
ThrowJsonException(
SR
.MetadataStandaloneValuesProperty);
794
ThrowJsonException(
SR
.MetadataInvalidPropertyWithLeadingDollarSign);
800
ThrowJsonException(
SR
.Format(
SR
.MetadataDuplicateIdFound, id));
806
ThrowJsonException(
SR
.Format(
SR
.DuplicateMetadataProperty, Encoding.UTF8.GetString(utf8PropertyName)));
812
ThrowJsonException(
SR
.Format(
SR
.MetadataInvalidReferenceToValueType, propertyType));
821
ThrowJsonException(
SR
.Format(
SR
.MetadataPreservedArrayFailed,
822
SR
.Format(
SR
.MetadataInvalidPropertyInArrayMetadata, propertyNameAsString),
823
SR
.Format(
SR
.DeserializeUnableToConvertValue, propertyType)));
832
ThrowJsonException(
SR
.Format(
SR
.MetadataPreservedArrayFailed,
833
SR
.MetadataStandaloneValuesProperty,
834
SR
.Format(
SR
.DeserializeUnableToConvertValue, propertyType)));
840
ThrowJsonException(
SR
.Format(
SR
.MetadataCannotParsePreservedObjectToImmutable, propertyType));
846
throw new InvalidOperationException(
SR
.Format(
SR
.MetadataReferenceOfTypeCannotBeAssignedToType, referenceId, currentType, typeToConvert));
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>"));
882
return new NotSupportedException(
SR
.Format(
SR
.AmbiguousMetadataForType, type, match1, match2));
888
throw new NotSupportedException(
SR
.Format(
SR
.ConstructorContainsNullParameterNames, declaringType));
894
throw new InvalidOperationException(
SR
.Format(
SR
.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
899
return new InvalidOperationException(
SR
.Format(
SR
.NoMetadataForTypeProperties, resolver?.ToString() ?? "<null>", type));
911
throw new MissingMemberException(
SR
.Format(
SR
.MissingFSharpCoreMember, missingFsharpCoreMember));
917
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
923
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
929
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_RuntimeTypeNotSupported, runtimeType, baseType));
935
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_RuntimeTypeDiamondAmbiguity, runtimeType, derivedType1, derivedType2, baseType));
941
throw new InvalidOperationException(
SR
.Format(
SR
.Polymorphism_TypeDoesNotSupportPolymorphism, 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));
965
throw new InvalidOperationException(
SR
.Polymorphism_InvalidCustomTypeDiscriminatorPropertyName);
971
throw new InvalidOperationException(
SR
.Format(
SR
.Polymorphism_PropertyConflictsWithMetadataPropertyName, type, propertyName));
977
throw new InvalidOperationException(
SR
.Format(
SR
.Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes, baseType));
983
throw new InvalidOperationException(
SR
.Format(
SR
.UnsupportedEnumIdentifier, enumType.Name, enumName));
989
ThrowJsonException(
SR
.Format(
SR
.Polymorphism_UnrecognizedTypeDiscriminator, typeDiscriminator));
995
throw new ArgumentException(
SR
.JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo, paramName: parameterName);
1001
throw new OperationCanceledException(
SR
.PipeWriterCanceled);
1007
throw new OperationCanceledException(
SR
.PipeReaderCanceled);
1013
throw new InvalidOperationException(
SR
.Format(
SR
.PipeWriter_DoesNotImplementUnflushedBytes, pipeWriter.GetType().Name));
1019
throw new NotSupportedException(
SR
.JsonSchemaExporter_ReferenceHandlerPreserve_NotSupported);
1025
throw new InvalidOperationException(
SR
.JsonSchemaExporter_DepthTooLarge);
System\Text\Json\Writer\JsonWriterHelper.cs (8)
169
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
199
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
222
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
235
SR
.Format(
SR
.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(val)),
241
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
252
SR
.Format(
SR
.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(utf8FormattedNumber[i])),
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
240
throw new ArgumentException(
SR
.StreamNotWritable);
302
throw new ArgumentException(
SR
.StreamNotWritable);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
145
ThrowHelper.ThrowArgumentException(
SR
.ExpectedJsonTokens);
234
ThrowHelper.ThrowArgumentException(
SR
.ExpectedJsonTokens);
System\ThrowHelper.cs (4)
6
using SR = System.
SR
;
21
throw new ArgumentException(
SR
.Argument_DestinationTooShort, "destination");
85
return
SR
.ArgumentOutOfRange_IndexMustBeLess;
87
return
SR
.Argument_CannotExtractScalar;