496 references to SR
System.Text.Json (496)
System\Text\Json\Document\JsonDocument.cs (1)
1140throw new ArgumentException(SR.JsonDocumentDoesNotSupportComments, paramName);
System\Text\Json\Document\JsonDocumentOptions.cs (1)
34throw new ArgumentOutOfRangeException(nameof(value), SR.JsonDocumentDoesNotSupportComments);
System\Text\Json\Document\JsonElement.cs (6)
143throw new KeyNotFoundException(SR.Format(SR.Arg_KeyNotFoundWithKey, propertyName)); 181throw new KeyNotFoundException(SR.Format(SR.Arg_KeyNotFoundWithKey, propertyName.ToString())); 221throw 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)
200throw 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)
90throw new InvalidOperationException(SR.Format(SR.FSharpUnionFieldConflictsWithDiscriminator, typeof(T), fields[i].FieldName, typeDiscriminatorPropertyName)); 126throw new InvalidOperationException(SR.Format(SR.FSharpUnionDuplicateCaseName, typeof(T), discriminatorName)); 131throw new InvalidOperationException(SR.Format(SR.FSharpUnionDuplicateCaseName, typeof(T), discriminatorName)); 283throw new JsonException(SR.Format(SR.FSharpUnionMissingDiscriminatorProperty, _typeDiscriminatorPropertyName, typeof(T))); 503throw new InvalidOperationException(SR.Format(SR.FSharpUnionDuplicateFieldName, declaringType, caseName, fields[i].FieldName));
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverter.cs (2)
15public string ErrorMessage => _errorMessage ?? SR.Format(SR.SerializeTypeInstanceNotSupported, typeof(T).FullName);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
69ThrowHelper.ThrowJsonException(SR.PolymorphicTypeClassifierReturnedNull);
System\Text\Json\Serialization\JsonSerializerOptions.cs (5)
344throw new ArgumentException(SR.SerializationInvalidBufferSize); 410throw new InvalidOperationException(SR.DefaultIgnoreConditionAlreadySpecified); 440throw new ArgumentException(SR.DefaultIgnoreConditionInvalid); 445throw new InvalidOperationException(SR.DefaultIgnoreConditionAlreadySpecified); 663throw new ArgumentOutOfRangeException(nameof(value), SR.JsonSerializerDoesNotSupportComments);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (8)
223baseType, entry.DerivedType, SR.Polymorphism_OpenGeneric_Reason_NotAssignable); 377failureReason = SR.Polymorphism_OpenGeneric_Reason_NotAssignable; 403failureReason = SR.Format(SR.Polymorphism_OpenGeneric_Reason_UnboundParameter, required.Name); 462failureReason = SR.Polymorphism_OpenGeneric_Reason_AmbiguousMatch; 469failureReason = SR.Polymorphism_OpenGeneric_Reason_UnificationFailed; 484failureReason = SR.Polymorphism_OpenGeneric_Reason_ConstraintViolation; 530ThrowHelper.ThrowInvalidOperationException(SR.DefaultIgnoreConditionInvalid);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (2)
326throw new InvalidOperationException(SR.Format(SR.SerializationConverterNotCompatible, typedConverter, typeof(T)));
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (2)
43throw new InvalidOperationException(SR.Format(SR.FieldCannotBeVirtual, nameof(propertyInfo.IsProperty), nameof(propertyInfo.IsVirtual)));
System\Text\Json\ThrowHelper.cs (156)
19throw GetArgumentOutOfRangeException(parameterName, SR.InvalidNewLine); 25throw GetArgumentOutOfRangeException(parameterName, SR.InvalidIndentCharacter); 31throw GetArgumentOutOfRangeException(parameterName, SR.Format(SR.InvalidIndentSize, minimumSize, maximumSize)); 37throw GetArgumentOutOfRangeException(parameterName, SR.MaxDepthMustBePositive); 43throw GetArgumentOutOfRangeException(parameterName, SR.JsonNumberExponentTooLarge); 54throw GetArgumentOutOfRangeException(parameterName, SR.CommentHandlingMustBeValid); 60throw new ArgumentOutOfRangeException(paramName, SR.ArrayIndexNegative); 66throw new ArgumentOutOfRangeException(nameof(typeToConvert), SR.Format(SR.SerializerConverterFactoryInvalidArgument, typeToConvert.FullName)); 72throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Generic_MustBeNonNegative); 78throw new ArgumentException(SR.Argument_InvalidOffLen); 84throw new ArgumentException(SR.ArrayTooSmall, paramName); 100return GetInvalidOperationException(SR.Format(SR.CallFlushToAvoidDataLoss, _buffered)); 106throw GetArgumentException(SR.DestinationTooShort); 112throw GetArgumentException(SR.Format(SR.PropertyNameTooLarge, tokenLength)); 118throw GetArgumentException(SR.Format(SR.ValueTooLarge, tokenLength)); 124throw GetArgumentException(SR.SpecialNumberValuesNotSupported); 130throw GetInvalidOperationException(SR.FailedToGetLargerSpan); 136throw GetArgumentException(SR.Format(SR.PropertyNameTooLarge, length)); 144ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length)); 149ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length)); 158ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length)); 163ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length)); 172ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length)); 177ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length)); 186ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length)); 191ThrowArgumentException(SR.Format(SR.ValueTooLarge, value.Length)); 201ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, maxDepth)); 206ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length)); 215ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, maxDepth)); 240return GetInvalidOperationException(SR.ZeroDepthAtEnd); 244return GetInvalidOperationException(SR.EmptyJsonIsInvalid); 254ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, maxDepth)); 259ThrowArgumentException(SR.Format(SR.PropertyNameTooLarge, propertyName.Length)); 312throw GetInvalidOperationException(SR.CannotSkip); 319throw GetInvalidOperationException(SR.Format(SR.CannotMixEncodings, GetEncodingName(previousEncoding), GetEncodingName(currentEncoding))); 337return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); 342return GetInvalidOperationException(SR.Format(SR.InvalidComparison, tokenType)); 358SR.Format(SR.JsonElementHasWrongType, expectedType, actualType)); 366SR.Format(SR.JsonElementHasWrongType, expectedTypeName, actualType)); 405message = SR.Format(SR.ArrayDepthTooLarge, json.CurrentState.Options.MaxDepth); 408message = SR.Format(SR.MismatchedObjectArray, character); 411message = SR.TrailingCommaNotAllowedBeforeArrayEnd; 414message = SR.TrailingCommaNotAllowedBeforeObjectEnd; 417message = SR.EndOfStringNotFound; 420message = SR.Format(SR.RequiredDigitNotFoundAfterSign, character); 423message = SR.Format(SR.RequiredDigitNotFoundAfterDecimal, character); 426message = SR.RequiredDigitNotFoundEndOfData; 429message = SR.Format(SR.ExpectedEndAfterSingleJson, character); 432message = SR.Format(SR.ExpectedEndOfDigitNotFound, character); 435message = SR.Format(SR.ExpectedNextDigitEValueNotFound, character); 438message = SR.Format(SR.ExpectedSeparatorAfterPropertyNameNotFound, character); 441message = SR.Format(SR.ExpectedStartOfPropertyNotFound, character); 444message = SR.ExpectedStartOfPropertyOrValueNotFound; 447message = SR.Format(SR.ExpectedStartOfPropertyOrValueAfterComment, character); 450message = SR.Format(SR.ExpectedStartOfValueNotFound, character); 453message = SR.ExpectedValueAfterPropertyNameNotFound; 456message = SR.Format(SR.FoundInvalidCharacter, character); 459message = SR.Format(SR.InvalidEndOfJsonNonPrimitive, json.TokenType); 462message = SR.Format(SR.ObjectDepthTooLarge, json.CurrentState.Options.MaxDepth); 465message = SR.Format(SR.ExpectedFalse, characters); 468message = SR.Format(SR.ExpectedNull, characters); 471message = SR.Format(SR.ExpectedTrue, characters); 474message = SR.Format(SR.InvalidCharacterWithinString, character); 477message = SR.Format(SR.InvalidCharacterAfterEscapeWithinString, character); 480message = SR.Format(SR.InvalidHexCharacterWithinString, character); 483message = SR.EndOfCommentNotFound; 486message = SR.ZeroDepthAtEnd; 489message = SR.ExpectedJsonTokens; 492message = SR.NotEnoughData; 495message = SR.ExpectedOneCompleteToken; 498message = SR.Format(SR.InvalidCharacterAtStartOfComment, character); 501message = SR.UnexpectedEndOfDataWhileReadingComment; 504message = SR.UnexpectedEndOfLineSeparator; 507message = SR.Format(SR.InvalidLeadingZeroInNumber, character); 526throw new ArgumentException(SR.CannotWriteCommentWithEmbeddedDelimiter); 554throw new ArgumentException(SR.Format(SR.CannotEncodeInvalidUTF8, builder)); 560throw new ArgumentException(SR.Format(SR.CannotEncodeInvalidUTF16, $"0x{charAsInt:X2}")); 566throw GetInvalidOperationException(SR.Format(SR.CannotReadInvalidUTF16, $"0x{charAsInt:X2}")); 572throw GetInvalidOperationException(SR.CannotReadIncompleteUTF16); 577return GetInvalidOperationException(SR.CannotTranscodeInvalidUtf8, innerException); 582return new ArgumentException(SR.CannotTranscodeInvalidUtf16, innerException); 604throw new OutOfMemoryException(SR.Format(SR.BufferMaximumSizeExceeded, capacity)); 617SR.Format(SR.CannotWriteEndAfterProperty, (char)token) : 618SR.Format(SR.MismatchedObjectArray, (char)token); 621message = SR.Format(SR.DepthTooLarge, currentDepth & JsonConstants.RemoveFlagsBitMask, maxDepth); 624message = SR.Format(SR.CannotStartObjectArrayWithoutProperty, tokenType); 627message = SR.Format(SR.CannotStartObjectArrayAfterPrimitiveOrClose, tokenType); 630message = SR.Format(SR.CannotWriteValueWithinObject, tokenType); 634SR.CannotWritePropertyAfterProperty : 635SR.Format(SR.CannotWritePropertyWithinArray, tokenType); 638message = SR.Format(SR.CannotWriteValueAfterPrimitiveOrClose, tokenType); 641message = SR.CannotWriteWithinString; 660throw new FormatException(SR.Format(SR.FormatNumericType, numericType)) { Source = ExceptionSourceValueToRethrowAsJsonException }; 678message = SR.Format(SR.UnsupportedFormat, dataType); 681message = SR.CannotDecodeInvalidBase64; 712throw new InsufficientExecutionStackException(SR.JsonElementDeepEqualsInsufficientExecutionStack);
System\Text\Json\ThrowHelper.Node.cs (15)
16throw new ArgumentException(SR.NodeValueNotAllowed, paramName); 22throw new ArgumentException(SR.Format(SR.NodeDuplicateKey, propertyName), paramName); 34throw new InvalidOperationException(SR.NodeAlreadyHasParent); 40throw new InvalidOperationException(SR.NodeCycleDetected); 46throw new InvalidOperationException(SR.NodeElementCannotBeObjectOrArray); 60throw new InvalidOperationException(SR.Format(SR.NodeWrongType, concatenatedNames)); 66throw new InvalidOperationException(SR.Format(SR.NodeParentWrongType, typeName)); 71return new NotSupportedException(SR.CollectionIsReadOnly); 77throw new InvalidOperationException(SR.Format(SR.NodeUnableToConvert, sourceType, destinationType)); 83throw new InvalidOperationException(SR.Format(SR.NodeUnableToConvertElement, valueKind, destinationType));
System\Text\Json\ThrowHelper.Serialization.cs (265)
22throw new ArgumentException(SR.Format(SR.DeserializeWrongType, type, value.GetType())); 28throw new ArgumentException(SR.JsonSerializerDoesNotSupportComments, paramName); 34throw new NotSupportedException(SR.Format(SR.SerializationNotSupportedType, propertyType)); 40throw new NotSupportedException(SR.Format(SR.TypeRequiresAsyncSerialization, propertyType)); 46throw new NotSupportedException(SR.Format(SR.DictionaryKeyTypeNotSupported, keyType, converter.GetType())); 52throw new JsonException(SR.Format(SR.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true }; 58throw new InvalidCastException(SR.Format(SR.DeserializeUnableToAssignValue, typeOfValue, declaredType)); 64throw new InvalidOperationException(SR.Format(SR.DeserializeUnableToAssignNull, declaredType)); 70throw new JsonException(SR.Format(SR.PropertyGetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true }; 76throw new JsonException(SR.Format(SR.PropertySetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true }; 82throw new JsonException(SR.Format(SR.ConstructorParameterDisallowNull, parameterName, declaringType)) { AppendPathInformation = true }; 88throw new InvalidOperationException(SR.Format(SR.ObjectCreationHandlingPopulateNotSupportedByConverter, propertyInfo.Name, propertyInfo.DeclaringType)); 94throw new InvalidOperationException(SR.Format(SR.ObjectCreationHandlingPropertyMustHaveAGetter, propertyInfo.Name, propertyInfo.DeclaringType)); 100throw new InvalidOperationException(SR.Format(SR.ObjectCreationHandlingPropertyValueTypeMustHaveASetter, propertyInfo.Name, propertyInfo.DeclaringType)); 106throw new InvalidOperationException(SR.Format(SR.ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization, propertyInfo.Name, propertyInfo.DeclaringType)); 112throw new InvalidOperationException(SR.Format(SR.ObjectCreationHandlingPropertyCannotAllowReadOnlyMember, propertyInfo.Name, propertyInfo.DeclaringType)); 118throw new InvalidOperationException(SR.ObjectCreationHandlingPropertyCannotAllowReferenceHandling); 124throw new NotSupportedException(SR.ObjectCreationHandlingPropertyDoesNotSupportParameterizedConstructors); 130throw new JsonException(SR.Format(SR.SerializationConverterRead, converter)) { AppendPathInformation = true }; 136throw new JsonException(SR.Format(SR.SerializationConverterWrite, converter)) { AppendPathInformation = true }; 142throw new JsonException(SR.Format(SR.SerializerCycleDetected, maxDepth)) { AppendPathInformation = true }; 157throw new ArgumentException(SR.Format(SR.CannotSerializeInvalidType, typeToConvert), paramName); 161throw new ArgumentException(SR.Format(SR.CannotSerializeInvalidMember, typeToConvert, propertyName, declaringType), paramName); 170throw new InvalidOperationException(SR.Format(SR.CannotSerializeInvalidType, typeToConvert)); 174throw new InvalidOperationException(SR.Format(SR.CannotSerializeInvalidMember, typeToConvert, memberInfo.Name, declaringType)); 180throw new InvalidOperationException(SR.Format(SR.SerializationConverterNotCompatible, converterType, type)); 186throw new InvalidOperationException(SR.Format(SR.ResolverTypeNotCompatible, actualType, requestedType)); 192throw new InvalidOperationException(SR.ResolverTypeInfoOptionsNotCompatible); 198throw new InvalidOperationException(SR.JsonSerializerOptionsNoTypeInfoResolverSpecified); 204throw new InvalidOperationException(SR.JsonSerializerIsReflectionDisabled); 216throw new InvalidOperationException(SR.Format(SR.SerializationConverterOnAttributeInvalid, location)); 229throw new InvalidOperationException(SR.Format(SR.SerializationConverterOnAttributeNotCompatible, location, typeToConvert)); 241throw new InvalidOperationException(SR.Format(SR.SerializationConverterOnAttributeOpenGenericNotCompatible, location, converterType)); 248? SR.SerializerOptionsReadOnly 249: SR.SerializerContextOptionsReadOnly; 257throw new InvalidOperationException(SR.DefaultTypeInfoResolverImmutable); 263throw new InvalidOperationException(SR.TypeInfoResolverChainImmutable); 269throw new InvalidOperationException(SR.TypeInfoImmutable); 275throw new InvalidOperationException(SR.SerializerOptions_InvalidChainedResolver); 281throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameConflict, type, propertyName)); 287throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameNull, jsonPropertyInfo.DeclaringType, jsonPropertyInfo.MemberName)); 293throw new InvalidOperationException(SR.Format(SR.JsonPropertyRequiredAndNotDeserializable, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType)); 299throw new InvalidOperationException(SR.Format(SR.JsonPropertyRequiredAndExtensionData, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType)); 318throw new JsonException(SR.Format(SR.JsonRequiredPropertiesMissing, parent.Type, builder.ToString())); 324throw new JsonException(SR.Format(SR.JsonRequiredPropertiesMissing, type, propertyList)); 351throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_JsonPropertyInfo, property.Name, property.DeclaringType)); 357throw new JsonException(SR.DuplicatePropertiesNotAllowed); 363throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name))); 370throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name))); 391throw new InvalidOperationException(SR.Format(SR.NamingPolicyReturnNull, namingPolicy)); 397throw new InvalidOperationException(SR.Format(SR.SerializerConverterFactoryReturnsNull, converterType)); 403throw new InvalidOperationException(SR.Format(SR.SerializerConverterFactoryReturnsJsonConverterFactory, converterType)); 414SR.Format( 415SR.MultipleMembersBindWithConstructorParameter, 425throw new InvalidOperationException(SR.Format(SR.ConstructorParamIncompleteBinding, parentType)); 431throw new InvalidOperationException(SR.Format(SR.ExtensionDataCannotBindToCtorParam, propertyName, jsonPropertyInfo.DeclaringType)); 437throw new InvalidOperationException(SR.Format(SR.JsonIncludeOnInaccessibleProperty, memberName, declaringType)); 443throw new InvalidOperationException(SR.Format(SR.IgnoreConditionOnValueTypeInvalid, clrPropertyName, propertyDeclaringType)); 450throw new InvalidOperationException(SR.Format(SR.NumberHandlingOnPropertyInvalid, jsonPropertyInfo.MemberName, jsonPropertyInfo.DeclaringType)); 456throw new InvalidOperationException(SR.Format(SR.ConverterCanConvertMultipleTypes, jsonConverter.GetType(), jsonConverter.Type, runtimePropertyType)); 469SR.Format(SR.ObjectWithParameterizedCtorRefMetadataNotSupported, jsonTypeInfo.Type)); 476throw new InvalidOperationException(SR.Format(SR.InvalidJsonTypeInfoOperationForKind, kind)); 482throw new InvalidOperationException(SR.Format(SR.OnDeserializingCallbacksNotSupported, type)); 488throw new InvalidOperationException(SR.Format(SR.CreateObjectConverterNotCompatible, type)); 546message = SR.Format(SR.DeserializeUnableToConvertValue, propertyType); 576message = SR.SerializeUnableToSerialize; 591throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateAttribute, attribute, location)); 597throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateTypeAttribute, classType, attribute)); 603throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateTypeAttribute, classType, typeof(TAttribute))); 609throw new InvalidOperationException(SR.Format(SR.ExtensionDataConflictsWithUnmappedMemberHandling, classType, jsonPropertyInfo.MemberName)); 615throw new InvalidOperationException(SR.Format(SR.SerializationDataExtensionPropertyInvalid, jsonPropertyInfo.PropertyType, jsonPropertyInfo.MemberName)); 621throw new InvalidOperationException(SR.Format(SR.PropertyTypeNotNullable, jsonPropertyInfo.PropertyType)); 627throw new InvalidOperationException(SR.NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty); 648message += SR.Format(SR.SerializationNotSupportedParentType, propertyType); 676message += SR.Format(SR.SerializationNotSupportedParentType, propertyType); 694message = SR.Format(SR.DeserializationMustSpecifyTypeDiscriminator, type); 698message = SR.Format(SR.CannotPopulateCollection, type); 702message = SR.Format(SR.DeserializeInterfaceOrAbstractType, type); 707message = SR.Format(SR.DeserializeNoConstructor, nameof(JsonConstructorAttribute), type); 716ThrowNotSupportedException(ref state, reader, new NotSupportedException(SR.Format(SR.CannotPopulateCollection, type))); 722ThrowJsonException(SR.Format(SR.MetadataInvalidTokenAfterValues, tokenType)); 728ThrowJsonException(SR.Format(SR.MetadataReferenceNotFound, id)); 734ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, tokenType)); 740ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, valueKind)); 754ThrowJsonException(SR.MetadataUnexpectedProperty); 760throw new JsonException(SR.Format(SR.UnmappedJsonProperty, unmappedPropertyName, type)); 766ThrowJsonException(SR.MetadataReferenceCannotContainOtherProperties); 773ThrowJsonException(SR.MetadataIdCannotBeCombinedWithRef); 780ThrowJsonException(SR.MetadataStandaloneValuesProperty); 796ThrowJsonException(SR.MetadataInvalidPropertyWithLeadingDollarSign); 802ThrowJsonException(SR.Format(SR.MetadataDuplicateIdFound, id)); 808ThrowJsonException(SR.Format(SR.DuplicateMetadataProperty, Encoding.UTF8.GetString(utf8PropertyName))); 814ThrowJsonException(SR.Format(SR.MetadataInvalidReferenceToValueType, propertyType)); 823ThrowJsonException(SR.Format(SR.MetadataPreservedArrayFailed, 824SR.Format(SR.MetadataInvalidPropertyInArrayMetadata, propertyNameAsString), 825SR.Format(SR.DeserializeUnableToConvertValue, propertyType))); 834ThrowJsonException(SR.Format(SR.MetadataPreservedArrayFailed, 835SR.MetadataStandaloneValuesProperty, 836SR.Format(SR.DeserializeUnableToConvertValue, propertyType))); 842ThrowJsonException(SR.Format(SR.MetadataCannotParsePreservedObjectToImmutable, propertyType)); 848throw new InvalidOperationException(SR.Format(SR.MetadataReferenceOfTypeCannotBeAssignedToType, referenceId, currentType, typeToConvert)); 855throw new InvalidOperationException(SR.Format(SR.JsonPropertyInfoBoundToDifferentParent, propertyInfo.Name, propertyInfo.DeclaringTypeInfo.Type.FullName)); 879throw new NotSupportedException(SR.Format(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>")); 884return new NotSupportedException(SR.Format(SR.AmbiguousMetadataForType, type, match1, match2)); 890throw new NotSupportedException(SR.Format(SR.ConstructorContainsNullParameterNames, declaringType)); 896throw new InvalidOperationException(SR.Format(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>")); 901return new InvalidOperationException(SR.Format(SR.NoMetadataForTypeProperties, resolver?.ToString() ?? "<null>", type)); 913throw new MissingMemberException(SR.Format(SR.MissingFSharpCoreMember, missingFsharpCoreMember)); 919throw new NotSupportedException(SR.Format(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType)); 925throw new NotSupportedException(SR.Format(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType)); 931throw new NotSupportedException(SR.Format(SR.Polymorphism_RuntimeTypeNotSupported, runtimeType, baseType)); 937throw new NotSupportedException(SR.Format(SR.Polymorphism_RuntimeTypeDiamondAmbiguity, runtimeType, derivedType1, derivedType2, baseType)); 943throw new InvalidOperationException(SR.Format(SR.Polymorphism_TypeDoesNotSupportPolymorphism, baseType)); 949throw new InvalidOperationException(SR.Format(SR.Polymorphism_DerivedTypeIsNotSupported, derivedType, baseType)); 955throw new InvalidOperationException(SR.Format(SR.Polymorphism_DerivedTypeIsAlreadySpecified, baseType, derivedType)); 961throw new InvalidOperationException(SR.Format(SR.Polymorphism_OpenGenericDerivedTypeCouldNotBeResolved, derivedType, baseType, reason)); 967throw new InvalidOperationException(SR.Format(SR.Polymorphism_TypeDicriminatorIdIsAlreadySpecified, baseType, typeDiscriminator)); 973throw new InvalidOperationException(SR.Format(SR.Polymorphism_InferredDerivedTypeIsNotAccessible, derivedType, baseType)); 979throw new InvalidOperationException(SR.Format(SR.Polymorphism_InferClosedTypePolymorphismOnNonClosedType, baseType)); 985throw new InvalidOperationException(SR.Polymorphism_InvalidCustomTypeDiscriminatorPropertyName); 991throw new InvalidOperationException(SR.Format(SR.Polymorphism_PropertyConflictsWithMetadataPropertyName, type, propertyName)); 997throw new InvalidOperationException(SR.Format(SR.Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes, baseType)); 1003ThrowJsonException(SR.Format(SR.UnionDoesNotAcceptNull, unionType)); 1009ThrowJsonException(SR.Format(SR.UnionRuntimeTypeNotMatchedToCase, runtimeType, unionType)); 1015ThrowJsonException(SR.Format(SR.UnionCannotCreateValue, unionType)); 1021ThrowJsonException(SR.Format(SR.UnionCannotReadValue, unionType)); 1027ThrowJsonException(SR.Format(SR.UnionTypeClassifierReturnedNull, unionType, tokenType)); 1033ThrowJsonException(SR.Format(SR.UnionAmbiguousJsonValueType, valueType, unionType)); 1039ThrowJsonException(SR.Format(SR.UnionJsonTokenTypeNotSupported, tokenType, unionType)); 1045throw new InvalidOperationException(SR.Format(SR.UnionCasesNotPopulated, unionType)); 1051throw new InvalidOperationException(SR.Format(SR.UnionCannotCreateValue, unionType)); 1057throw new InvalidOperationException(SR.Format(SR.UnionCannotReadValue, unionType)); 1063throw new InvalidOperationException(SR.Format(SR.UnionTypeStructuralClassifierOnlyForUnions, unionType)); 1072SR.Format( 1073SR.UnionTypeStructuralClassifierCaseNotSupported, 1082SR.Format( 1083SR.UnionTypeStructuralClassifierPreserveReferencesNotSupported, 1095SR.Format( 1096SR.UnionTypeStructuralClassifierAmbiguousCases, 1110SR.Format( 1111SR.UnionTypeStructuralClassifierUnreachableObjectCase, 1120throw new InvalidOperationException(SR.Format(SR.TypeClassifierMustDeriveFromJsonTypeClassifierFactory, classifierType, type)); 1126throw new InvalidOperationException(SR.Format(SR.TypeClassifierNotSupported, classifierType, type)); 1132throw new InvalidOperationException(SR.Format(SR.UnsupportedEnumIdentifier, enumType.Name, enumName)); 1138ThrowJsonException(SR.Format(SR.Polymorphism_UnrecognizedTypeDiscriminator, typeDiscriminator)); 1144throw new ArgumentException(SR.JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo, paramName: parameterName); 1150throw new OperationCanceledException(SR.PipeWriterCanceled); 1156throw new OperationCanceledException(SR.PipeReaderCanceled); 1162throw new InvalidOperationException(SR.Format(SR.PipeWriter_DoesNotImplementUnflushedBytes, pipeWriter.GetType().Name)); 1168throw new NotSupportedException(SR.JsonSchemaExporter_ReferenceHandlerPreserve_NotSupported); 1174throw new InvalidOperationException(SR.JsonSchemaExporter_DepthTooLarge);
System\Text\Json\Writer\JsonWriterHelper.cs (8)
168throw new ArgumentException(SR.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber)); 198throw new ArgumentException(SR.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber)); 221throw new ArgumentException(SR.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber)); 234SR.Format(SR.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(val)), 240throw new ArgumentException(SR.RequiredDigitNotFoundEndOfData, nameof(utf8FormattedNumber)); 251SR.Format(SR.ExpectedEndOfDigitNotFound, ThrowHelper.GetPrintableString(utf8FormattedNumber[i])),
System\Text\Json\Writer\Utf8JsonWriter.cs (2)
240throw new ArgumentException(SR.StreamNotWritable); 309throw new ArgumentException(SR.StreamNotWritable);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
145ThrowHelper.ThrowArgumentException(SR.ExpectedJsonTokens); 234ThrowHelper.ThrowArgumentException(SR.ExpectedJsonTokens);
System\ThrowHelper.cs (4)
6using SR = System.SR; 21throw new ArgumentException(SR.Argument_DestinationTooShort, "destination"); 85return SR.ArgumentOutOfRange_IndexMustBeLess; 87return SR.Argument_CannotExtractScalar;