439 references to SR
System.Text.Json (439)
System\Text\Json\Document\JsonDocument.cs (1)
1124
throw new ArgumentException(
SR
.JsonDocumentDoesNotSupportComments, paramName);
System\Text\Json\Document\JsonDocumentOptions.cs (1)
34
throw new ArgumentOutOfRangeException(nameof(value),
SR
.JsonDocumentDoesNotSupportComments);
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)
198
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\FSharpTypeConverterFactory.cs (1)
69
return UnsupportedTypeConverterFactory.CreateUnsupportedConverterForType(typeToConvert,
SR
.FSharpDiscriminatedUnionsNotSupported);
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)
326
throw new ArgumentException(
SR
.SerializationInvalidBufferSize);
392
throw new InvalidOperationException(
SR
.DefaultIgnoreConditionAlreadySpecified);
422
throw new ArgumentException(
SR
.DefaultIgnoreConditionInvalid);
427
throw new InvalidOperationException(
SR
.DefaultIgnoreConditionAlreadySpecified);
645
throw new ArgumentOutOfRangeException(nameof(value),
SR
.JsonSerializerDoesNotSupportComments);
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 (173)
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
.Format(
SR
.ZeroDepthAtEnd, currentDepth));
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
.Format(
SR
.ZeroDepthAtEnd);
489
message =
SR
.ExpectedJsonTokens;
492
message =
SR
.NotEnoughData;
495
message =
SR
.ExpectedOneCompleteToken;
498
message =
SR
.Format(
SR
.InvalidCharacterAtStartOfComment, character);
501
message =
SR
.Format(
SR
.UnexpectedEndOfDataWhileReadingComment);
504
message =
SR
.Format(
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
.Format(
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 (215)
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));
236
?
SR
.SerializerOptionsReadOnly
237
:
SR
.SerializerContextOptionsReadOnly;
245
throw new InvalidOperationException(
SR
.DefaultTypeInfoResolverImmutable);
251
throw new InvalidOperationException(
SR
.TypeInfoResolverChainImmutable);
257
throw new InvalidOperationException(
SR
.TypeInfoImmutable);
263
throw new InvalidOperationException(
SR
.SerializerOptions_InvalidChainedResolver);
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 InvalidOperationException(
SR
.Format(
SR
.NamingPolicyReturnNull, namingPolicy));
335
throw new InvalidOperationException(
SR
.Format(
SR
.SerializerConverterFactoryReturnsNull, converterType));
341
throw new InvalidOperationException(
SR
.Format(
SR
.SerializerConverterFactoryReturnsJsonConverterFactory, converterType));
352
SR
.Format(
353
SR
.MultipleMembersBindWithConstructorParameter,
363
throw new InvalidOperationException(
SR
.Format(
SR
.ConstructorParamIncompleteBinding, parentType));
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));
394
throw new InvalidOperationException(
SR
.Format(
SR
.ConverterCanConvertMultipleTypes, jsonConverter.GetType(), jsonConverter.Type, runtimePropertyType));
407
SR
.Format(
SR
.ObjectWithParameterizedCtorRefMetadataNotSupported, jsonTypeInfo.Type));
414
throw new InvalidOperationException(
SR
.Format(
SR
.InvalidJsonTypeInfoOperationForKind, kind));
420
throw new InvalidOperationException(
SR
.Format(
SR
.OnDeserializingCallbacksNotSupported, type));
426
throw new InvalidOperationException(
SR
.Format(
SR
.CreateObjectConverterNotCompatible, type));
482
message =
SR
.Format(
SR
.DeserializeUnableToConvertValue, propertyType);
512
message =
SR
.Format(
SR
.SerializeUnableToSerialize);
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));
557
throw new InvalidOperationException(
SR
.Format(
SR
.PropertyTypeNotNullable, jsonPropertyInfo.PropertyType));
563
throw new InvalidOperationException(
SR
.NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty);
584
message +=
SR
.Format(
SR
.SerializationNotSupportedParentType, propertyType);
612
message +=
SR
.Format(
SR
.SerializationNotSupportedParentType, propertyType);
630
message =
SR
.Format(
SR
.DeserializationMustSpecifyTypeDiscriminator, type);
634
message =
SR
.Format(
SR
.CannotPopulateCollection, type);
638
message =
SR
.Format(
SR
.DeserializeInterfaceOrAbstractType, type);
643
message =
SR
.Format(
SR
.DeserializeNoConstructor, nameof(JsonConstructorAttribute), type);
652
ThrowNotSupportedException(ref state, reader, new NotSupportedException(
SR
.Format(
SR
.CannotPopulateCollection, type)));
658
ThrowJsonException(
SR
.Format(
SR
.MetadataInvalidTokenAfterValues, tokenType));
664
ThrowJsonException(
SR
.Format(
SR
.MetadataReferenceNotFound, id));
670
ThrowJsonException(
SR
.Format(
SR
.MetadataValueWasNotString, tokenType));
676
ThrowJsonException(
SR
.Format(
SR
.MetadataValueWasNotString, valueKind));
690
ThrowJsonException(
SR
.Format(
SR
.MetadataUnexpectedProperty));
696
throw new JsonException(
SR
.Format(
SR
.UnmappedJsonProperty, unmappedPropertyName, type));
702
ThrowJsonException(
SR
.MetadataReferenceCannotContainOtherProperties);
709
ThrowJsonException(
SR
.MetadataIdCannotBeCombinedWithRef);
716
ThrowJsonException(
SR
.MetadataStandaloneValuesProperty);
732
ThrowJsonException(
SR
.MetadataInvalidPropertyWithLeadingDollarSign);
738
ThrowJsonException(
SR
.Format(
SR
.MetadataDuplicateIdFound, id));
744
ThrowJsonException(
SR
.Format(
SR
.DuplicateMetadataProperty, JsonHelpers.Utf8GetString(utf8PropertyName)));
750
ThrowJsonException(
SR
.Format(
SR
.MetadataInvalidReferenceToValueType, propertyType));
759
ThrowJsonException(
SR
.Format(
SR
.MetadataPreservedArrayFailed,
760
SR
.Format(
SR
.MetadataInvalidPropertyInArrayMetadata, propertyNameAsString),
761
SR
.Format(
SR
.DeserializeUnableToConvertValue, propertyType)));
770
ThrowJsonException(
SR
.Format(
SR
.MetadataPreservedArrayFailed,
771
SR
.MetadataStandaloneValuesProperty,
772
SR
.Format(
SR
.DeserializeUnableToConvertValue, propertyType)));
778
ThrowJsonException(
SR
.Format(
SR
.MetadataCannotParsePreservedObjectToImmutable, propertyType));
784
throw new InvalidOperationException(
SR
.Format(
SR
.MetadataReferenceOfTypeCannotBeAssignedToType, referenceId, currentType, typeToConvert));
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>"));
820
return new NotSupportedException(
SR
.Format(
SR
.AmbiguousMetadataForType, type, match1, match2));
826
throw new NotSupportedException(
SR
.Format(
SR
.ConstructorContainsNullParameterNames, declaringType));
832
throw new InvalidOperationException(
SR
.Format(
SR
.NoMetadataForType, type, resolver?.ToString() ?? "<null>"));
837
return new InvalidOperationException(
SR
.Format(
SR
.NoMetadataForTypeProperties, resolver?.ToString() ?? "<null>", type));
849
throw new MissingMemberException(
SR
.Format(
SR
.MissingFSharpCoreMember, missingFsharpCoreMember));
855
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
861
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType));
867
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_RuntimeTypeNotSupported, runtimeType, baseType));
873
throw new NotSupportedException(
SR
.Format(
SR
.Polymorphism_RuntimeTypeDiamondAmbiguity, runtimeType, derivedType1, derivedType2, baseType));
879
throw new InvalidOperationException(
SR
.Format(
SR
.Polymorphism_TypeDoesNotSupportPolymorphism, 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));
903
throw new InvalidOperationException(
SR
.Polymorphism_InvalidCustomTypeDiscriminatorPropertyName);
909
throw new InvalidOperationException(
SR
.Format(
SR
.Polymorphism_PropertyConflictsWithMetadataPropertyName, type, propertyName));
915
throw new InvalidOperationException(
SR
.Format(
SR
.Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes, baseType));
921
throw new InvalidOperationException(
SR
.Format(
SR
.UnsupportedEnumIdentifier, enumType.Name, enumName));
927
ThrowJsonException(
SR
.Format(
SR
.Polymorphism_UnrecognizedTypeDiscriminator, typeDiscriminator));
933
throw new ArgumentException(
SR
.JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo, paramName: parameterName);
939
throw new OperationCanceledException(
SR
.PipeWriterCanceled);
945
throw new InvalidOperationException(
SR
.Format(
SR
.PipeWriter_DoesNotImplementUnflushedBytes, pipeWriter.GetType().Name));
951
throw new NotSupportedException(
SR
.JsonSchemaExporter_ReferenceHandlerPreserve_NotSupported);
957
throw new InvalidOperationException(
SR
.JsonSchemaExporter_DepthTooLarge);
System\Text\Json\Writer\JsonWriterHelper.cs (8)
168
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
198
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
221
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
234
SR
.Format(
SR
.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(val)),
240
throw new ArgumentException(
SR
.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber));
251
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;