439 references to SR
System.Text.Json (439)
System\Text\Json\Document\JsonDocument.cs (1)
1124throw new ArgumentException(SR.JsonDocumentDoesNotSupportComments, paramName);
System\Text\Json\Document\JsonDocumentOptions.cs (1)
34throw 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)
198throw 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)
69return UnsupportedTypeConverterFactory.CreateUnsupportedConverterForType(typeToConvert, SR.FSharpDiscriminatedUnionsNotSupported);
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverter.cs (2)
15public string ErrorMessage => _errorMessage ?? SR.Format(SR.SerializeTypeInstanceNotSupported, typeof(T).FullName);
System\Text\Json\Serialization\JsonSerializerOptions.cs (5)
326throw new ArgumentException(SR.SerializationInvalidBufferSize); 392throw new InvalidOperationException(SR.DefaultIgnoreConditionAlreadySpecified); 422throw new ArgumentException(SR.DefaultIgnoreConditionInvalid); 427throw new InvalidOperationException(SR.DefaultIgnoreConditionAlreadySpecified); 645throw new ArgumentOutOfRangeException(nameof(value), SR.JsonSerializerDoesNotSupportComments);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (2)
327throw new InvalidOperationException(SR.Format(SR.SerializationConverterNotCompatible, typedConverter, typeof(T)));
System\Text\Json\Serialization\Metadata\JsonMetadataServices.cs (2)
42throw new InvalidOperationException(SR.Format(SR.FieldCannotBeVirtual, nameof(propertyInfo.IsProperty), nameof(propertyInfo.IsVirtual)));
System\Text\Json\ThrowHelper.cs (173)
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.Format(SR.ZeroDepthAtEnd, currentDepth)); 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.Format(SR.ZeroDepthAtEnd); 489message = SR.ExpectedJsonTokens; 492message = SR.NotEnoughData; 495message = SR.ExpectedOneCompleteToken; 498message = SR.Format(SR.InvalidCharacterAtStartOfComment, character); 501message = SR.Format(SR.UnexpectedEndOfDataWhileReadingComment); 504message = SR.Format(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.Format(SR.CannotWritePropertyAfterProperty) : 635SR.Format(SR.CannotWritePropertyWithinArray, tokenType); 638message = SR.Format(SR.CannotWriteValueAfterPrimitiveOrClose, tokenType); 641message = SR.CannotWriteWithinString; 664message = SR.FormatByte; 667message = SR.FormatSByte; 670message = SR.FormatInt16; 673message = SR.FormatInt32; 676message = SR.FormatInt64; 679message = SR.FormatInt128; 682message = SR.FormatUInt16; 685message = SR.FormatUInt32; 688message = SR.FormatUInt64; 691message = SR.FormatUInt128; 694message = SR.FormatHalf; 697message = SR.FormatSingle; 700message = SR.FormatDouble; 703message = SR.FormatDecimal; 728message = SR.Format(SR.UnsupportedFormat, dataType); 731message = SR.CannotDecodeInvalidBase64; 762throw 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 (215)
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)); 236? SR.SerializerOptionsReadOnly 237: SR.SerializerContextOptionsReadOnly; 245throw new InvalidOperationException(SR.DefaultTypeInfoResolverImmutable); 251throw new InvalidOperationException(SR.TypeInfoResolverChainImmutable); 257throw new InvalidOperationException(SR.TypeInfoImmutable); 263throw new InvalidOperationException(SR.SerializerOptions_InvalidChainedResolver); 269throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameConflict, type, propertyName)); 275throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameNull, jsonPropertyInfo.DeclaringType, jsonPropertyInfo.MemberName)); 281throw new InvalidOperationException(SR.Format(SR.JsonPropertyRequiredAndNotDeserializable, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType)); 287throw new InvalidOperationException(SR.Format(SR.JsonPropertyRequiredAndExtensionData, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType)); 323throw new JsonException(SR.Format(SR.JsonRequiredPropertiesMissing, parent.Type, listOfMissingPropertiesBuilder.ToString())); 329throw new InvalidOperationException(SR.Format(SR.NamingPolicyReturnNull, namingPolicy)); 335throw new InvalidOperationException(SR.Format(SR.SerializerConverterFactoryReturnsNull, converterType)); 341throw new InvalidOperationException(SR.Format(SR.SerializerConverterFactoryReturnsJsonConverterFactory, converterType)); 352SR.Format( 353SR.MultipleMembersBindWithConstructorParameter, 363throw new InvalidOperationException(SR.Format(SR.ConstructorParamIncompleteBinding, parentType)); 369throw new InvalidOperationException(SR.Format(SR.ExtensionDataCannotBindToCtorParam, propertyName, jsonPropertyInfo.DeclaringType)); 375throw new InvalidOperationException(SR.Format(SR.JsonIncludeOnInaccessibleProperty, memberName, declaringType)); 381throw new InvalidOperationException(SR.Format(SR.IgnoreConditionOnValueTypeInvalid, clrPropertyName, propertyDeclaringType)); 388throw new InvalidOperationException(SR.Format(SR.NumberHandlingOnPropertyInvalid, jsonPropertyInfo.MemberName, jsonPropertyInfo.DeclaringType)); 394throw new InvalidOperationException(SR.Format(SR.ConverterCanConvertMultipleTypes, jsonConverter.GetType(), jsonConverter.Type, runtimePropertyType)); 407SR.Format(SR.ObjectWithParameterizedCtorRefMetadataNotSupported, jsonTypeInfo.Type)); 414throw new InvalidOperationException(SR.Format(SR.InvalidJsonTypeInfoOperationForKind, kind)); 420throw new InvalidOperationException(SR.Format(SR.OnDeserializingCallbacksNotSupported, type)); 426throw new InvalidOperationException(SR.Format(SR.CreateObjectConverterNotCompatible, type)); 482message = SR.Format(SR.DeserializeUnableToConvertValue, propertyType); 512message = SR.Format(SR.SerializeUnableToSerialize); 527throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateAttribute, attribute, location)); 533throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateTypeAttribute, classType, attribute)); 539throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateTypeAttribute, classType, typeof(TAttribute))); 545throw new InvalidOperationException(SR.Format(SR.ExtensionDataConflictsWithUnmappedMemberHandling, classType, jsonPropertyInfo.MemberName)); 551throw new InvalidOperationException(SR.Format(SR.SerializationDataExtensionPropertyInvalid, jsonPropertyInfo.PropertyType, jsonPropertyInfo.MemberName)); 557throw new InvalidOperationException(SR.Format(SR.PropertyTypeNotNullable, jsonPropertyInfo.PropertyType)); 563throw new InvalidOperationException(SR.NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty); 584message += SR.Format(SR.SerializationNotSupportedParentType, propertyType); 612message += SR.Format(SR.SerializationNotSupportedParentType, propertyType); 630message = SR.Format(SR.DeserializationMustSpecifyTypeDiscriminator, type); 634message = SR.Format(SR.CannotPopulateCollection, type); 638message = SR.Format(SR.DeserializeInterfaceOrAbstractType, type); 643message = SR.Format(SR.DeserializeNoConstructor, nameof(JsonConstructorAttribute), type); 652ThrowNotSupportedException(ref state, reader, new NotSupportedException(SR.Format(SR.CannotPopulateCollection, type))); 658ThrowJsonException(SR.Format(SR.MetadataInvalidTokenAfterValues, tokenType)); 664ThrowJsonException(SR.Format(SR.MetadataReferenceNotFound, id)); 670ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, tokenType)); 676ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, valueKind)); 690ThrowJsonException(SR.Format(SR.MetadataUnexpectedProperty)); 696throw new JsonException(SR.Format(SR.UnmappedJsonProperty, unmappedPropertyName, type)); 702ThrowJsonException(SR.MetadataReferenceCannotContainOtherProperties); 709ThrowJsonException(SR.MetadataIdCannotBeCombinedWithRef); 716ThrowJsonException(SR.MetadataStandaloneValuesProperty); 732ThrowJsonException(SR.MetadataInvalidPropertyWithLeadingDollarSign); 738ThrowJsonException(SR.Format(SR.MetadataDuplicateIdFound, id)); 744ThrowJsonException(SR.Format(SR.DuplicateMetadataProperty, JsonHelpers.Utf8GetString(utf8PropertyName))); 750ThrowJsonException(SR.Format(SR.MetadataInvalidReferenceToValueType, propertyType)); 759ThrowJsonException(SR.Format(SR.MetadataPreservedArrayFailed, 760SR.Format(SR.MetadataInvalidPropertyInArrayMetadata, propertyNameAsString), 761SR.Format(SR.DeserializeUnableToConvertValue, propertyType))); 770ThrowJsonException(SR.Format(SR.MetadataPreservedArrayFailed, 771SR.MetadataStandaloneValuesProperty, 772SR.Format(SR.DeserializeUnableToConvertValue, propertyType))); 778ThrowJsonException(SR.Format(SR.MetadataCannotParsePreservedObjectToImmutable, propertyType)); 784throw new InvalidOperationException(SR.Format(SR.MetadataReferenceOfTypeCannotBeAssignedToType, referenceId, currentType, typeToConvert)); 791throw new InvalidOperationException(SR.Format(SR.JsonPropertyInfoBoundToDifferentParent, propertyInfo.Name, propertyInfo.DeclaringTypeInfo.Type.FullName)); 815throw new NotSupportedException(SR.Format(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>")); 820return new NotSupportedException(SR.Format(SR.AmbiguousMetadataForType, type, match1, match2)); 826throw new NotSupportedException(SR.Format(SR.ConstructorContainsNullParameterNames, declaringType)); 832throw new InvalidOperationException(SR.Format(SR.NoMetadataForType, type, resolver?.ToString() ?? "<null>")); 837return new InvalidOperationException(SR.Format(SR.NoMetadataForTypeProperties, resolver?.ToString() ?? "<null>", type)); 849throw new MissingMemberException(SR.Format(SR.MissingFSharpCoreMember, missingFsharpCoreMember)); 855throw new NotSupportedException(SR.Format(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType)); 861throw new NotSupportedException(SR.Format(SR.Polymorphism_DerivedConverterDoesNotSupportMetadata, derivedType)); 867throw new NotSupportedException(SR.Format(SR.Polymorphism_RuntimeTypeNotSupported, runtimeType, baseType)); 873throw new NotSupportedException(SR.Format(SR.Polymorphism_RuntimeTypeDiamondAmbiguity, runtimeType, derivedType1, derivedType2, baseType)); 879throw new InvalidOperationException(SR.Format(SR.Polymorphism_TypeDoesNotSupportPolymorphism, baseType)); 885throw new InvalidOperationException(SR.Format(SR.Polymorphism_DerivedTypeIsNotSupported, derivedType, baseType)); 891throw new InvalidOperationException(SR.Format(SR.Polymorphism_DerivedTypeIsAlreadySpecified, baseType, derivedType)); 897throw new InvalidOperationException(SR.Format(SR.Polymorphism_TypeDicriminatorIdIsAlreadySpecified, baseType, typeDiscriminator)); 903throw new InvalidOperationException(SR.Polymorphism_InvalidCustomTypeDiscriminatorPropertyName); 909throw new InvalidOperationException(SR.Format(SR.Polymorphism_PropertyConflictsWithMetadataPropertyName, type, propertyName)); 915throw new InvalidOperationException(SR.Format(SR.Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes, baseType)); 921throw new InvalidOperationException(SR.Format(SR.UnsupportedEnumIdentifier, enumType.Name, enumName)); 927ThrowJsonException(SR.Format(SR.Polymorphism_UnrecognizedTypeDiscriminator, typeDiscriminator)); 933throw new ArgumentException(SR.JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo, paramName: parameterName); 939throw new OperationCanceledException(SR.PipeWriterCanceled); 945throw new InvalidOperationException(SR.Format(SR.PipeWriter_DoesNotImplementUnflushedBytes, pipeWriter.GetType().Name)); 951throw new NotSupportedException(SR.JsonSchemaExporter_ReferenceHandlerPreserve_NotSupported); 957throw 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); 302throw 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;