129 references to JsonException
aspire (7)
Configuration\FlexibleBooleanDictionaryConverter.cs (6)
25
throw new
JsonException
($"Expected StartObject, got {reader.TokenType}");
39
throw new
JsonException
($"Expected PropertyName, got {reader.TokenType}");
42
var key = reader.GetString() ?? throw new
JsonException
("Property name cannot be null");
51
_ => throw new
JsonException
($"Cannot convert {reader.TokenType} to boolean for key '{key}'")
57
throw new
JsonException
("Unexpected end of JSON");
84
throw new
JsonException
($"Cannot convert string '{value}' to boolean for key '{key}'. Expected 'true' or 'false'.");
Utils\EnvironmentChecker\EnvironmentCheckResult.cs (1)
107
_ => throw new
JsonException
($"Unknown status value: {value}")
Aspire.Dashboard (7)
Model\GenAI\GenAIMessageParsingHelper.cs (6)
36
throw new
JsonException
("Expected a JSON array.");
91
throw new
JsonException
("Expected start of chat message object.");
107
throw new
JsonException
("Expected property name.");
117
throw new
JsonException
("Unexpected end of JSON while reading role value.");
128
throw new
JsonException
("Unexpected end of JSON while reading property value.");
133
throw new
JsonException
("Unexpected end of JSON while skipping property value.");
Model\GenAI\GenAIMessages.cs (1)
217
throw new
JsonException
("Missing 'type' property.");
Aspire.Dashboard.Tests (1)
Model\GenAIItemPartViewModelTests.cs (1)
177
Error = new
JsonException
("Test deserialization error"),
Microsoft.AspNetCore.Components.Server (3)
src\aspnetcore\src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34
throw new
JsonException
($"Unexpected JSON property '{reader.GetString()}'.");
39
throw new
JsonException
($"Unexpected JSON Token {reader.TokenType}.");
45
throw new
JsonException
("__internalId is required.");
Microsoft.AspNetCore.Components.Web (13)
WebEventData\ChangeEventArgsReader.cs (1)
43
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\ClipboardEventArgsReader.cs (1)
25
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\DragEventArgsReader.cs (2)
73
throw new
JsonException
($"Unknown property {property.Name}");
95
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\ErrorEventArgsReader.cs (1)
45
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\FocusEventArgsReader.cs (1)
25
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\KeyboardEventArgsReader.cs (1)
70
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\MouseEventArgsReader.cs (1)
117
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\ProgressEventArgReader.cs (1)
40
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\TouchEventArgsReader.cs (2)
72
throw new
JsonException
($"Unknown property {property.Name}");
126
throw new
JsonException
($"Unknown property {property.Name}");
WebEventData\WebEventDescriptorReader.cs (2)
38
throw new
JsonException
($"Unknown property {property.Name}");
72
throw new
JsonException
($"Unknown property {property.Name}");
Microsoft.AspNetCore.Identity (2)
Passkeys\BufferSourceJsonConverter.cs (2)
24
throw new
JsonException
("Unexpected escaped value in base64url string.");
30
throw new
JsonException
("Expected a valid base64url string.");
Microsoft.Diagnostics.DataContractReader (4)
ContractDescriptorParser.cs (4)
133
throw new
JsonException
($"Size specified multiple times: {size} and {newSize}");
145
throw new
JsonException
($"Duplicate field name: {fieldName}");
232
throw new
JsonException
("Indirect global value could not be converted to a number.");
263
throw new
JsonException
("Indirect global value could not be converted to a number.");
Microsoft.Extensions.AI.Abstractions (2)
Embeddings\BinaryEmbedding.cs (2)
52
throw new
JsonException
("Expected string property.");
77
_ => throw new
JsonException
("Expected binary character sequence.")
Microsoft.Extensions.AI.Evaluation.Reporting (8)
JsonSerialization\EvaluationContextConverter.cs (5)
27
throw new
JsonException
($"Unexpected token '{reader.TokenType}'.");
45
throw new
JsonException
(
54
throw new
JsonException
(
64
throw new
JsonException
(
77
throw new
JsonException
($"Missing required properties '{NamePropertyName}' and '{ContentsPropertyName}'.");
Storage\DiskBasedResponseCache.CacheEntry.cs (2)
39
throw new
JsonException
(
56
throw new
JsonException
(
Storage\DiskBasedResultStore.cs (1)
75
? throw new
JsonException
(
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (8)
src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting\CSharp\JsonSerialization\EvaluationContextConverter.cs (5)
27
throw new
JsonException
($"Unexpected token '{reader.TokenType}'.");
45
throw new
JsonException
(
54
throw new
JsonException
(
64
throw new
JsonException
(
77
throw new
JsonException
($"Missing required properties '{NamePropertyName}' and '{ContentsPropertyName}'.");
Storage\AzureStorageResponseCache.CacheEntry.cs (2)
44
?? throw new
JsonException
(
62
?? throw new
JsonException
(
Storage\AzureStorageResultStore.cs (1)
119
?? throw new
JsonException
(
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIResponseClientTests.cs (1)
6212
throw new
JsonException
($"Unrecognized property '{propertyName}'.");
Microsoft.JSInterop (22)
Implementation\JSObjectReferenceJsonWorker.cs (3)
38
throw new
JsonException
($"Unexpected JSON property {reader.GetString()}.");
43
throw new
JsonException
($"Unexpected JSON token {reader.TokenType}");
49
throw new
JsonException
($"Required property {JSObjectIdKey} not found.");
Infrastructure\ByteArrayJsonConverter.cs (8)
33
throw new
JsonException
("JSON serialization is attempting to deserialize an unexpected byte array.");
40
throw new
JsonException
($"Unexpected JSON Token {reader.TokenType}, expected 'StartObject'.");
47
throw new
JsonException
($"Unexpected JSON Property {reader.GetString()}.");
51
throw new
JsonException
($"Unexpected JSON Token {reader.TokenType}, expected 'Number'.");
55
throw new
JsonException
($"Unexpected number, expected 32-bit integer.");
60
throw new
JsonException
($"Unexpected JSON Token {reader.TokenType}, expected 'PropertyName'.");
65
throw new
JsonException
($"Unexpected JSON Token {reader.TokenType}, expected 'EndObject'.");
70
throw new
JsonException
($"Byte array {byteArrayRef} not found.");
Infrastructure\DotNetDispatcher.cs (4)
232
throw new
JsonException
("Invalid JSON");
259
throw new
JsonException
($"Unexpected JSON token {reader.TokenType}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters.");
319
throw new
JsonException
("Invalid JSON");
336
throw new
JsonException
("Invalid JSON");
Infrastructure\DotNetObjectReferenceJsonConverter.cs (3)
37
throw new
JsonException
($"Unexpected JSON property {reader.GetString()}.");
42
throw new
JsonException
($"Unexpected JSON Token {reader.TokenType}.");
48
throw new
JsonException
($"Required property {DotNetObjectRefKey} not found.");
Infrastructure\JSStreamReferenceJsonConverter.cs (4)
45
throw new
JsonException
($"Unexpected JSON property {reader.GetString()}.");
50
throw new
JsonException
($"Unexpected JSON token {reader.TokenType}");
56
throw new
JsonException
($"Required property {JSObjectReferenceJsonWorker.JSObjectIdKey} not found.");
61
throw new
JsonException
($"Required property {_jsStreamReferenceLengthKey} not found.");
Microsoft.ML.Tokenizers (1)
Utils\StringSpanOrdinalKey.cs (1)
166
throw new
JsonException
("Invalid JSON.");
NuGet.ProjectModel (12)
LockFile\Utf8JsonStreamIAssetsLogMessageConverter.cs (1)
53
throw new
JsonException
("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileConverter.cs (1)
51
throw new
JsonException
("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileItemConverter.cs (1)
38
throw new
JsonException
("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileLibraryConverter.cs (2)
45
throw new
JsonException
("Expected PropertyName, found " + reader.TokenType);
57
throw new
JsonException
("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetConverter.cs (1)
24
throw new
JsonException
("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetConverterV4.cs (1)
23
throw new
JsonException
("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetLibraryConverter.cs (2)
76
throw new
JsonException
("Expected PropertyName, found " + reader.TokenType);
90
throw new
JsonException
("Expected StartObject, found " + reader.TokenType);
src\nuget-client\build\Shared\Utf8JsonStreamReader.cs (2)
133
throw new
JsonException
($"Expected start object token but instead found '{TokenType}'");
158
throw new
JsonException
($"Expected start array token but instead found '{TokenType}'");
Utf8JsonStreamProjectFileDependencyGroupConverter.cs (1)
24
throw new
JsonException
("Expected PropertyName, found " + reader.TokenType);
NuGet.Protocol (22)
Converters\MetadataStringOrArrayStjConverter.cs (2)
28
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
39
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
Converters\NuGetFrameworkStjConverter.cs (1)
28
_ => throw new
JsonException
(string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType))
Converters\NuGetVersionStjConverter.cs (1)
24
_ => throw new
JsonException
(string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType))
Converters\PackageDependencyGroupStjConverter.cs (3)
26
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
36
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
65
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
Converters\Utf8JsonReaderExtensions.cs (1)
28
_ => throw new
JsonException
(string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType))
Model\RepositoryCertificateInfo.cs (4)
51
Fingerprints = fingerprints ?? throw new System.Text.Json.
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Fingerprints));
52
Subject = subject ?? throw new System.Text.Json.
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Subject));
53
Issuer = issuer ?? throw new System.Text.Json.
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Issuer));
56
ContentUrl = contentUrl ?? throw new System.Text.Json.
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.ContentUrl));
Plugins\MessageConverter.cs (8)
110
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.RequestId)));
116
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(Message.RequestId)));
121
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Type)));
127
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, typeStr));
132
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Method)));
138
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, methodStr));
146
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedPayloadTokenType, payloadProp.ValueKind));
163
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, $"{messageMethod}/{messageType}"));
Plugins\RawJsonStringConverter.cs (1)
22
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedPayloadTokenType, reader.TokenType));
Plugins\StjSemanticVersionConverter.cs (1)
23
throw new
JsonException
(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
System.Text.Json (16)
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (1)
283
throw new
JsonException
(SR.Format(SR.FSharpUnionMissingDiscriminatorProperty, _typeDiscriminatorPropertyName, typeof(T)));
System\Text\Json\ThrowHelper.Serialization.cs (15)
52
throw new
JsonException
(SR.Format(SR.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true };
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 };
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 };
148
throw new
JsonException
(message) { AppendPathInformation = true };
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)));
760
throw new
JsonException
(SR.Format(SR.UnmappedJsonProperty, unmappedPropertyName, type));