1 type derived from JsonException
System.Text.Json (1)
System\Text\Json\Reader\JsonReaderException.cs (1)
10internal sealed class JsonReaderException : JsonException
163 instantiations of JsonException
aspire (8)
Configuration\AspireConfigFile.cs (1)
132throw new JsonException(
Configuration\FlexibleBooleanDictionaryConverter.cs (6)
25throw new JsonException($"Expected StartObject, got {reader.TokenType}"); 39throw new JsonException($"Expected PropertyName, got {reader.TokenType}"); 42var key = reader.GetString() ?? throw new JsonException("Property name cannot be null"); 51_ => throw new JsonException($"Cannot convert {reader.TokenType} to boolean for key '{key}'") 57throw new JsonException("Unexpected end of JSON"); 84throw 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.Cli.Tests (2)
Commands\ExtensionInternalCommandTests.cs (2)
88throw new JsonException($"Failed to deserialize JSON: {allOutput}", ex); 130throw new JsonException($"Failed to deserialize JSON: {allOutput}", ex);
Aspire.Dashboard (7)
Model\GenAI\GenAIMessageParsingHelper.cs (6)
36throw new JsonException("Expected a JSON array."); 91throw new JsonException("Expected start of chat message object."); 107throw new JsonException("Expected property name."); 117throw new JsonException("Unexpected end of JSON while reading role value."); 128throw new JsonException("Unexpected end of JSON while reading property value."); 133throw new JsonException("Unexpected end of JSON while skipping property value.");
Model\GenAI\GenAIMessages.cs (1)
217throw new JsonException("Missing 'type' property.");
Aspire.Dashboard.Tests (1)
Model\GenAIItemPartViewModelTests.cs (1)
177Error = new JsonException("Test deserialization error"),
cdac-build-tool (4)
JsonConverter\FieldModelJsonConverter.cs (1)
18throw new JsonException();
JsonConverter\GlobalModelJsonConverter.cs (1)
13throw new JsonException();
JsonConverter\GlobalValueJsonConverter.cs (1)
13throw new JsonException();
JsonConverter\TypeModelJsonConverter.cs (1)
15throw new JsonException();
Microsoft.AspNetCore.Components.Server (3)
src\aspnetcore\src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34throw new JsonException($"Unexpected JSON property '{reader.GetString()}'."); 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 45throw new JsonException("__internalId is required.");
Microsoft.AspNetCore.Components.Web (13)
WebEventData\ChangeEventArgsReader.cs (1)
43throw new JsonException($"Unknown property {property.Name}");
WebEventData\ClipboardEventArgsReader.cs (1)
25throw new JsonException($"Unknown property {property.Name}");
WebEventData\DragEventArgsReader.cs (2)
73throw new JsonException($"Unknown property {property.Name}"); 95throw new JsonException($"Unknown property {property.Name}");
WebEventData\ErrorEventArgsReader.cs (1)
45throw new JsonException($"Unknown property {property.Name}");
WebEventData\FocusEventArgsReader.cs (1)
25throw new JsonException($"Unknown property {property.Name}");
WebEventData\KeyboardEventArgsReader.cs (1)
70throw new JsonException($"Unknown property {property.Name}");
WebEventData\MouseEventArgsReader.cs (1)
117throw new JsonException($"Unknown property {property.Name}");
WebEventData\ProgressEventArgReader.cs (1)
40throw new JsonException($"Unknown property {property.Name}");
WebEventData\TouchEventArgsReader.cs (2)
72throw new JsonException($"Unknown property {property.Name}"); 126throw new JsonException($"Unknown property {property.Name}");
WebEventData\WebEventDescriptorReader.cs (2)
38throw new JsonException($"Unknown property {property.Name}"); 72throw new JsonException($"Unknown property {property.Name}");
Microsoft.AspNetCore.Identity (2)
Passkeys\BufferSourceJsonConverter.cs (2)
24throw new JsonException("Unexpected escaped value in base64url string."); 30throw new JsonException("Expected a valid base64url string.");
Microsoft.Diagnostics.DataContractReader (22)
ContractDescriptorParser.cs (22)
116throw new JsonException(); 133throw new JsonException($"Size specified multiple times: {size} and {newSize}"); 142throw new JsonException(); 145throw new JsonException($"Duplicate field name: {fieldName}"); 153throw new JsonException(); 156throw new JsonException(); 175throw new JsonException(); 180throw new JsonException(); 183throw new JsonException(); 187throw new JsonException(); 193throw new JsonException(); 212throw new JsonException(); 232throw new JsonException("Indirect global value could not be converted to a number."); 240throw new JsonException(); 243throw new JsonException(); 251throw new JsonException(); 254throw new JsonException(); 257throw new JsonException(); 261throw new JsonException(); 263throw new JsonException("Indirect global value could not be converted to a number."); 266throw new JsonException(); 271throw new JsonException();
Microsoft.DotNet.HotReload.Utils.Generator.Data (2)
Script\Json\ScriptCapabilitiesConverter.cs (2)
22_ => throw new JsonException(), 28throw new JsonException();
Microsoft.Extensions.AI.Abstractions (2)
Embeddings\BinaryEmbedding.cs (2)
52throw new JsonException("Expected string property."); 77_ => throw new JsonException("Expected binary character sequence.")
Microsoft.Extensions.AI.Evaluation.Reporting (8)
JsonSerialization\EvaluationContextConverter.cs (5)
27throw new JsonException($"Unexpected token '{reader.TokenType}'."); 45throw new JsonException( 54throw new JsonException( 64throw new JsonException( 77throw new JsonException($"Missing required properties '{NamePropertyName}' and '{ContentsPropertyName}'.");
Storage\DiskBasedResponseCache.CacheEntry.cs (2)
39throw new JsonException( 56throw 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)
27throw new JsonException($"Unexpected token '{reader.TokenType}'."); 45throw new JsonException( 54throw new JsonException( 64throw new JsonException( 77throw 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)
6212throw new JsonException($"Unrecognized property '{propertyName}'.");
Microsoft.JSInterop (22)
Implementation\JSObjectReferenceJsonWorker.cs (3)
38throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 43throw new JsonException($"Unexpected JSON token {reader.TokenType}"); 49throw new JsonException($"Required property {JSObjectIdKey} not found.");
Infrastructure\ByteArrayJsonConverter.cs (8)
33throw new JsonException("JSON serialization is attempting to deserialize an unexpected byte array."); 40throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'StartObject'."); 47throw new JsonException($"Unexpected JSON Property {reader.GetString()}."); 51throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'Number'."); 55throw new JsonException($"Unexpected number, expected 32-bit integer."); 60throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'PropertyName'."); 65throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'EndObject'."); 70throw new JsonException($"Byte array {byteArrayRef} not found.");
Infrastructure\DotNetDispatcher.cs (4)
232throw new JsonException("Invalid JSON"); 259throw new JsonException($"Unexpected JSON token {reader.TokenType}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters."); 319throw new JsonException("Invalid JSON"); 336throw new JsonException("Invalid JSON");
Infrastructure\DotNetObjectReferenceJsonConverter.cs (3)
37throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 42throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 48throw new JsonException($"Required property {DotNetObjectRefKey} not found.");
Infrastructure\JSStreamReferenceJsonConverter.cs (4)
45throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 50throw new JsonException($"Unexpected JSON token {reader.TokenType}"); 56throw new JsonException($"Required property {JSObjectReferenceJsonWorker.JSObjectIdKey} not found."); 61throw new JsonException($"Required property {_jsStreamReferenceLengthKey} not found.");
Microsoft.ML.Tokenizers (1)
Utils\StringSpanOrdinalKey.cs (1)
166throw new JsonException("Invalid JSON.");
Microsoft.TemplateEngine.Edge (1)
BuiltInManagedProvider\GlobalSettings.cs (1)
99var wrappedEx = new JsonException(string.Format(LocalizableStrings.GlobalSettings_Error_CorruptedSettings, _globalSettingsFile, ex.Message), ex.Path, ex.LineNumber, ex.BytePositionInLine, ex);
NuGet.ProjectModel (12)
LockFile\Utf8JsonStreamIAssetsLogMessageConverter.cs (1)
53throw new JsonException("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileConverter.cs (1)
51throw new JsonException("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileItemConverter.cs (1)
38throw new JsonException("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileLibraryConverter.cs (2)
45throw new JsonException("Expected PropertyName, found " + reader.TokenType); 57throw new JsonException("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetConverter.cs (1)
24throw new JsonException("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetConverterV4.cs (1)
23throw new JsonException("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetLibraryConverter.cs (2)
76throw new JsonException("Expected PropertyName, found " + reader.TokenType); 90throw new JsonException("Expected StartObject, found " + reader.TokenType);
src\nuget-client\build\Shared\Utf8JsonStreamReader.cs (2)
133throw new JsonException($"Expected start object token but instead found '{TokenType}'"); 158throw new JsonException($"Expected start array token but instead found '{TokenType}'");
Utf8JsonStreamProjectFileDependencyGroupConverter.cs (1)
24throw new JsonException("Expected PropertyName, found " + reader.TokenType);
NuGet.Protocol (23)
Converters\FingerprintsStjConverter.cs (1)
18throw new JsonException();
Converters\MetadataStringOrArrayStjConverter.cs (2)
28throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType)); 39throw 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)
26throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType)); 36throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType)); 65throw 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)
51Fingerprints = fingerprints ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Fingerprints)); 52Subject = subject ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Subject)); 53Issuer = issuer ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Issuer)); 56ContentUrl = contentUrl ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.ContentUrl));
Plugins\MessageConverter.cs (8)
110throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.RequestId))); 116throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(Message.RequestId))); 121throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Type))); 127throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, typeStr)); 132throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Method))); 138throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, methodStr)); 146throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedPayloadTokenType, payloadProp.ValueKind)); 163throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, $"{messageMethod}/{messageType}"));
Plugins\RawJsonStringConverter.cs (1)
22throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedPayloadTokenType, reader.TokenType));
Plugins\StjSemanticVersionConverter.cs (1)
23throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
System.Text.Json (21)
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (1)
283throw new JsonException(SR.Format(SR.FSharpUnionMissingDiscriminatorProperty, _typeDiscriminatorPropertyName, typeof(T)));
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (2)
54throw new JsonException(); 75throw new JsonException();
System\Text\Json\ThrowHelper.Serialization.cs (18)
52throw new JsonException(SR.Format(SR.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true }; 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 }; 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 }; 148throw new JsonException(message) { AppendPathInformation = true }; 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))); 514throw new JsonException(message, path, ex.LineNumber, ex.BytePositionInLine, ex); 520JsonException jsonException = new JsonException(null, ex); 560JsonException jsonException = new JsonException(null, ex); 760throw new JsonException(SR.Format(SR.UnmappedJsonProperty, unmappedPropertyName, type));
214 references to JsonException
aspire (22)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (1)
191catch (JsonException)
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (1)
174catch (JsonException)
Agents\DeprecatedMcpCommandScanner.cs (1)
86catch (JsonException ex)
Agents\McpConfigFileHelper.cs (3)
54catch (JsonException) 67/// <exception cref="InvalidOperationException">Thrown when the file exists but contains malformed JSON, wrapping the underlying <see cref="JsonException"/>.</exception> 86catch (JsonException ex)
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (1)
139catch (JsonException)
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (1)
225catch (JsonException)
Commands\AddCommand.cs (1)
113catch (JsonException ex)
Commands\AgentInitCommand.cs (1)
262if (ex.InnerException is JsonException)
Commands\McpCallCommand.cs (1)
105catch (JsonException ex)
Configuration\AspireConfigFile.cs (1)
130catch (JsonException ex)
DotNet\DotNetCliRunner.cs (2)
863catch (JsonException ex) 989catch (JsonException ex)
Npm\SigstoreNpmProvenanceChecker.cs (1)
129catch (JsonException)
NuGet\BundleNuGetPackageCache.cs (1)
208catch (JsonException ex)
Projects\GuestAppHostProject.cs (2)
205catch (JsonException ex) 619catch (JsonException ex)
Projects\ProjectLocator.cs (1)
185catch (JsonException ex)
Utils\ConfigurationHelper.cs (1)
125catch (JsonException ex)
Utils\EnvironmentChecker\ContainerRuntimeCheck.cs (1)
529catch (JsonException)
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (1)
73catch (JsonException)
Aspire.Cli.Tests (6)
Commands\ExtensionInternalCommandTests.cs (2)
85catch (JsonException ex) 127catch (JsonException ex)
Configuration\AspireConfigFileTests.cs (4)
92var ex = Assert.Throws<JsonException>(() => AspireConfigFile.Load(workspace.WorkspaceRoot.FullName)); 106var ex = Assert.Throws<JsonException>(() => AspireConfigFile.Load(workspace.WorkspaceRoot.FullName));
Aspire.Dashboard (7)
Model\GenAI\GenAIMessageParsingHelper.cs (3)
46catch (JsonException) 69catch (JsonException) 157catch (JsonException)
Model\GenAI\GenAIMessages.cs (1)
236catch (JsonException ex)
Model\TelemetryImportService.cs (1)
121catch (JsonException ex)
Model\TextVisualizerViewModel.cs (1)
109catch (JsonException)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (1)
168catch (JsonException ex)
Aspire.Dashboard.Tests (1)
Model\GenAIMessageParsingHelperTests.cs (1)
34Assert.Throws<JsonException>(() =>
Aspire.Hosting (4)
Dashboard\DashboardEventHandlers.cs (1)
846catch (JsonException)
Pipelines\Internal\UserSecretsDeploymentStateManager.cs (1)
43catch (JsonException ex)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
119catch (JsonException ex)
Utils\ExtensionUtils.cs (1)
35catch (JsonException)
Aspire.Hosting.Azure (1)
AzureBicepResource.cs (1)
422catch (JsonException) { }
Aspire.Hosting.Azure.Functions (1)
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (1)
119catch (JsonException ex)
Aspire.Hosting.DevTunnels (1)
DevTunnelCliClient.cs (1)
307catch (JsonException ex)
Aspire.Hosting.Docker (1)
DockerComposeServiceResource.cs (1)
479catch (JsonException ex)
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
1098catch (JsonException)
Aspire.Hosting.OpenAI (1)
OpenAIHealthCheck.cs (1)
128catch (JsonException jex)
Aspire.Hosting.RemoteHost (1)
Ats\AtsMarshaller.cs (1)
630catch (JsonException)
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
364catch (JsonException ex)
dotnet (3)
src\sdk\src\Common\WorkloadFileBasedInstall.cs (1)
67catch (JsonException)
ToolManifest\ToolManifestEditor.cs (1)
216e is JsonException || e is FormatException)
ToolPackage\LocalToolsResolverCache.cs (1)
100catch (JsonException)
dotnet-sourcelink (1)
ILCompiler.Compiler (1)
src\runtime\src\coreclr\tools\Common\Microsoft\SourceLink\Tools\SourceLinkMap.cs (1)
57/// <exception cref="JsonException"><paramref name="json"/> is not valid JSON string.</exception>
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
1421catch (JsonException ex)
Microsoft.AspNetCore.Identity (11)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (1)
1427catch (System.Text.Json.JsonException jsonException)
PasskeyExceptionExtensions.cs (5)
108public static PasskeyException InvalidAttestationCredentialJsonFormat(JsonException ex) 114public static PasskeyException InvalidAssertionCredentialJsonFormat(JsonException ex) 120public static PasskeyException InvalidClientDataJsonFormat(JsonException ex) 132public static PasskeyException InvalidAttestationStateJsonFormat(JsonException ex) 135public static PasskeyException InvalidAssertionStateJsonFormat(JsonException ex)
PasskeyHandler.cs (5)
227catch (JsonException ex) 242catch (JsonException ex) 385catch (JsonException ex) 400catch (JsonException ex) 581catch (JsonException ex)
Microsoft.AspNetCore.Mvc.Core (2)
Formatters\SystemTextJsonInputFormatter.cs (2)
88catch (JsonException jsonException) 133private Exception WrapExceptionForModelState(JsonException jsonException)
Microsoft.AspNetCore.SignalR.Protocols.Json (2)
Protocol\JsonHubProtocol.cs (2)
417catch (JsonException ex) 475catch (JsonException jrex)
Microsoft.Build (2)
Construction\Solution\SolutionFile.cs (2)
653catch (Exception e) when (e is JsonException || e is KeyNotFoundException || e is InvalidOperationException) 676catch (Exception e) when (e is JsonException || e is KeyNotFoundException || e is InvalidOperationException)
Microsoft.CodeAnalysis.Features (1)
PdbSourceDocument\SourceLinkMap.cs (1)
62/// <exception cref="JsonException"><paramref name="json"/> is not valid JSON string.</exception>
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Rpc\RpcClient.cs (1)
65catch (JsonException ex)
Microsoft.DotNet.Cli.Definitions (1)
Commands\Test\TestCommandDefinition.cs (1)
96catch (Exception ex) when (ex is JsonException or IOException or UnauthorizedAccessException)
Microsoft.DotNet.HotReload.Utils.Generator (1)
Script\Json\Parsing.cs (1)
33} catch (JsonException exn) {
Microsoft.DotNet.HotReload.Utils.Generator.Tasks (1)
HotReloadDeltaGeneratorComputeScriptOutputs.cs (1)
71catch (JsonException exn)
Microsoft.DotNet.HotReload.Watch (2)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAssetsManifest.cs (2)
114/// <exception cref="JsonException">The format is invalid.</exception> 123catch (JsonException e)
Microsoft.DotNet.ProjectTools (1)
LaunchSettings\LaunchSettings.cs (1)
166catch (Exception ex) when (ex is JsonException or IOException)
Microsoft.Extensions.AI.Abstractions (6)
Functions\AIFunctionFactory.cs (6)
105/// <exception cref="JsonException">A parameter to <paramref name="method"/> is not serializable.</exception> 174/// <exception cref="JsonException">A parameter to <paramref name="method"/> is not serializable.</exception> 263/// <exception cref="JsonException">A parameter to <paramref name="method"/> or its return type is not serializable.</exception> 342/// <exception cref="JsonException">A parameter to <paramref name="method"/> or its return type is not serializable.</exception> 442/// <exception cref="JsonException">A parameter to <paramref name="method"/> or its return type is not serializable.</exception> 864catch (JsonException)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\FunctionCallContentTests.cs (1)
383[InlineData(typeof(JsonException))]
Embeddings\BinaryEmbeddingTests.cs (1)
94Assert.Throws<JsonException>(() => JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.Embedding));
Microsoft.Extensions.AI.Evaluation.Quality (4)
IntentResolutionEvaluator.cs (2)
343catch (JsonException) 368catch (JsonException ex)
RelevanceTruthAndCompletenessEvaluator.cs (2)
291catch (JsonException) 316catch (JsonException ex)
Microsoft.Extensions.AI.Evaluation.Tests (6)
IntentResolutionRatingTests.cs (3)
286Assert.Throws<JsonException>(() => IntentResolutionRating.FromJson(json)); 302Assert.Throws<JsonException>(() => IntentResolutionRating.FromJson(json)); 322Assert.Throws<JsonException>(() => IntentResolutionRating.FromJson(json));
RelevanceTruthAndCompletenessRatingTests.cs (3)
342Assert.Throws<JsonException>(() => RelevanceTruthAndCompletenessRating.FromJson(json)); 358Assert.Throws<JsonException>(() => RelevanceTruthAndCompletenessRating.FromJson(json)); 380Assert.Throws<JsonException>(() => RelevanceTruthAndCompletenessRating.FromJson(json));
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
126catch (JsonException)
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (2)
248var ex = Assert.Throws<JsonException>(() => response.Result);
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationProvider.cs (1)
32catch (JsonException e)
Microsoft.SourceLink.Tools.Package (1)
SourceLinkMap.cs (1)
82/// <exception cref="JsonException"><paramref name="json"/> is not valid JSON string.</exception>
Microsoft.TemplateEngine.Cli (1)
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (1)
202catch (JsonException)
Microsoft.TemplateEngine.Edge (2)
BuiltInManagedProvider\GlobalSettings.cs (2)
97catch (JsonException ex) 99var wrappedEx = new JsonException(string.Format(LocalizableStrings.GlobalSettings_Error_CorruptedSettings, _globalSettingsFile, ex.Message), ex.Path, ex.LineNumber, ex.BytePositionInLine, ex);
NuGet.Packaging (1)
NupkgMetadata\NupkgMetadataFileFormat.cs (1)
54catch (JsonException ex)
NuGet.ProjectModel (2)
CacheFileFormat.cs (1)
64catch (Exception ex) when (ex is ArgumentNullException || ex is JsonException || ex is NotSupportedException)
DependencyGraphSpec.cs (1)
282catch (System.Text.Json.JsonException ex)
NuGet.Protocol (2)
Converters\Utf8JsonReaderExtensions.cs (1)
16/// Throws <see cref="JsonException"/> for non-scalar tokens (including Null — handle that in the caller).
Providers\ServiceIndexResourceV3Provider.cs (1)
216catch (JsonException ex)
System.Text.Json (104)
src\runtime\src\libraries\System.Text.Json\Common\JsonCommentHandling.cs (1)
14/// <see cref="JsonException"/> is thrown.
System\Text\Json\Document\JsonDocument.Parse.cs (8)
41/// <exception cref="JsonException"> 71/// <exception cref="JsonException"> 116/// <exception cref="JsonException"> 202/// <exception cref="JsonException"> 276/// <exception cref="JsonException"> 343/// <exception cref="JsonException"> 391/// <exception cref="JsonException"> 431/// <exception cref="JsonException">
System\Text\Json\Document\JsonDocumentOptions.cs (4)
25/// By default <exception cref="JsonException"/> is thrown if a comment is encountered. 47/// Reading past this depth will throw a <exception cref="JsonException"/>. 68/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if a trailing comma is encountered. 77/// By default, it's set to true. If set to false, <see cref="JsonException"/> is thrown
System\Text\Json\Document\JsonElement.Parse.cs (5)
44/// <exception cref="JsonException"> 82/// <exception cref="JsonException"><paramref name="utf8Json"/> does not represent a valid single JSON value.</exception> 96/// <exception cref="JsonException"><paramref name="json"/> does not represent a valid single JSON value.</exception> 111/// <exception cref="JsonException"><paramref name="json"/> does not represent a valid single JSON value.</exception> 156/// <exception cref="JsonException">
System\Text\Json\Nodes\JsonNode.Parse.cs (5)
44/// <exception cref="JsonException"> 67/// <exception cref="JsonException"> 90/// <exception cref="JsonException"> 112/// <exception cref="JsonException"> 137/// <exception cref="JsonException">
System\Text\Json\Reader\JsonReaderOptions.cs (4)
25/// By default <exception cref="JsonException"/> is thrown if a comment is encountered. 49/// Reading past this depth will throw a <exception cref="JsonException"/>. 70/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if a trailing comma is encountered. 79/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if trailing content is encountered after the first top-level JSON value.
System\Text\Json\Reader\Utf8JsonReader.cs (3)
274/// <exception cref="JsonException"> 298/// <exception cref="JsonException"> 352/// <exception cref="JsonException">
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (1)
657private JsonException GetInvalidLiteralMultiSegment(ReadOnlySpan<byte> span)
System\Text\Json\Serialization\Attributes\JsonUnionAttribute.cs (1)
54/// and otherwise throws a <see cref="JsonException"/>. See
System\Text\Json\Serialization\JsonConverterOfT.ReadCore.cs (1)
74case JsonException jsonEx when jsonEx.Path is null:
System\Text\Json\Serialization\JsonConverterOfT.WriteCore.cs (1)
33case JsonException { Path: null } jsonException:
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (4)
22/// <exception cref="JsonException"> 50/// <exception cref="JsonException"> 83/// <exception cref="JsonException"> 137/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Element.cs (4)
19/// <exception cref="JsonException"> 45/// <exception cref="JsonException"> 73/// <exception cref="JsonException"> 121/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (4)
21/// <exception cref="JsonException"> 43/// <exception cref="JsonException"> 70/// <exception cref="JsonException"> 112/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Pipe.cs (5)
32/// <exception cref="JsonException"> 68/// <exception cref="JsonException"> 98/// <exception cref="JsonException"> 128/// <exception cref="JsonException"> 169/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (5)
20/// <exception cref="JsonException"> 47/// <exception cref="JsonException"> 73/// <exception cref="JsonException"> 92/// <exception cref="JsonException"> 114/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (10)
32/// <exception cref="JsonException"> 65/// <exception cref="JsonException"> 100/// <exception cref="JsonException"> 135/// <exception cref="JsonException"> 172/// <exception cref="JsonException"> 202/// <exception cref="JsonException"> 229/// <exception cref="JsonException"> 255/// <exception cref="JsonException"> 284/// <exception cref="JsonException"> 322/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (10)
28/// <exception cref="JsonException"> 62/// <exception cref="JsonException"> 97/// <exception cref="JsonException"> 135/// <exception cref="JsonException"> 178/// <exception cref="JsonException"> 214/// <exception cref="JsonException"> 248/// <exception cref="JsonException"> 275/// <exception cref="JsonException"> 306/// <exception cref="JsonException"> 351/// <exception cref="JsonException">
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (7)
21/// <exception cref="JsonException"> 75/// <exception cref="JsonException"> 127/// <exception cref="JsonException"> 173/// <exception cref="JsonException"> 223/// <exception cref="JsonException"> 288catch (JsonException) 313catch (JsonException)
System\Text\Json\Serialization\JsonSerializerOptions.cs (4)
307/// By default, it's set to false, and <exception cref="JsonException"/> is thrown if a trailing comma is encountered. 576/// Going past this depth will throw a <exception cref="JsonException"/>. 647/// By default <exception cref="JsonException"/> is thrown if a comment is encountered. 860/// By default, it's set to true. If set to false, <see cref="JsonException"/> is thrown
System\Text\Json\Serialization\JsonTypeClassifier.cs (2)
14/// failure and causes a <see cref="System.Text.Json.JsonException"/> to be thrown. 23/// is nullable, and otherwise throws a <see cref="System.Text.Json.JsonException"/>.
System\Text\Json\Serialization\JsonTypeClassifierFactory.cs (1)
39/// one case is nullable, and otherwise throws a <see cref="JsonException"/>. See
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (2)
519/// throw a <see cref="JsonException"/>. On the null path the <c>caseType</c> argument 1167/// surfaced as a <see cref="JsonException"/> only at deserialization time when a token
System\Text\Json\Serialization\ReferenceHandler.cs (2)
34/// * A <see cref="JsonException"/> is thrown if a `$ref` metadata property is found within the JSON object. 44/// If the JSON is not well-formed, a <see cref="JsonException"/> is thrown.
System\Text\Json\ThrowHelper.cs (1)
376public static JsonException GetJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, ReadOnlySpan<byte> bytes)
System\Text\Json\ThrowHelper.Serialization.cs (4)
520JsonException jsonException = new JsonException(null, ex); 525public static void AddJsonExceptionInformation(scoped ref ReadStack state, in Utf8JsonReader reader, JsonException ex) 560JsonException jsonException = new JsonException(null, ex); 565public static void AddJsonExceptionInformation(ref WriteStack state, JsonException ex)
System\Text\Json\Writer\JsonWriterOptions.cs (1)
97/// Reading past this depth will throw a <exception cref="JsonException"/>.
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (4)
19/// <exception cref="JsonException"> 52/// <exception cref="JsonException"> 83/// <exception cref="JsonException"> 119/// <exception cref="JsonException">