diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetrySolutionInfoEnricher.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetrySolutionInfoEnricher.cs index e01768c418..c57d51e6f2 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetrySolutionInfoEnricher.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Activity/Providers/TelemetrySolutionInfoEnricher.cs @@ -114,7 +114,10 @@ internal sealed class TelemetrySolutionInfoEnricher : TelemetryActivityEventEnri } var moduleJsonFileContent = File.ReadAllText(modulePath); - using var moduleDoc = JsonDocument.Parse(moduleJsonFileContent); + using var moduleDoc = JsonDocument.Parse(moduleJsonFileContent, new JsonDocumentOptions + { + AllowTrailingCommas = true + }); if (!moduleDoc.RootElement.TryGetProperty("imports", out var imports)) { diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/AbpStudioDetector.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/AbpStudioDetector.cs index 3d35c7192a..b37760cb04 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/AbpStudioDetector.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/AbpStudioDetector.cs @@ -40,7 +40,10 @@ internal sealed class AbpStudioDetector : SoftwareDetector return null; } using var fs = new FileStream(ideStateJsonPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - using var doc = JsonDocument.Parse(fs); + using var doc = JsonDocument.Parse(fs, new JsonDocumentOptions + { + AllowTrailingCommas = true + }); return doc.RootElement.TryGetProperty("theme", out var themeElement) ? themeElement.GetString() : null; } @@ -55,7 +58,10 @@ internal sealed class AbpStudioDetector : SoftwareDetector } using var fs = new FileStream(extensionsFilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - using var doc = JsonDocument.Parse(fs); + using var doc = JsonDocument.Parse(fs, new JsonDocumentOptions + { + AllowTrailingCommas = true + }); if (doc.RootElement.TryGetProperty("Extensions", out var extensionsElement) && extensionsElement.ValueKind == JsonValueKind.Array) diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/VisualStudioCodeDetector.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/VisualStudioCodeDetector.cs index 72fda0f500..52559663c2 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/VisualStudioCodeDetector.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/EnvironmentInspection/Detectors/VisualStudioCodeDetector.cs @@ -77,7 +77,10 @@ internal sealed class VisualStudioCodeDetector : SoftwareDetector { try { - using var jsonDoc = JsonDocument.Parse(File.ReadAllText(productJson)); + using var jsonDoc = JsonDocument.Parse(File.ReadAllText(productJson), new JsonDocumentOptions + { + AllowTrailingCommas = true + }); var root = jsonDoc.RootElement; if (root.TryGetProperty("version", out var versionProp)) { @@ -105,7 +108,10 @@ internal sealed class VisualStudioCodeDetector : SoftwareDetector { try { - using var json = JsonDocument.Parse( File.ReadAllText(settingsPath)); + using var json = JsonDocument.Parse( File.ReadAllText(settingsPath), new JsonDocumentOptions + { + AllowTrailingCommas = true + }); var root = json.RootElement; if (root.TryGetProperty("theme", out var themeProp)) { diff --git a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Helpers/AbpPackageMetadataReader.cs b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Helpers/AbpPackageMetadataReader.cs index f9ce98a2e5..446462c527 100644 --- a/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Helpers/AbpPackageMetadataReader.cs +++ b/framework/src/Volo.Abp.Core/Volo/Abp/Internal/Telemetry/Helpers/AbpPackageMetadataReader.cs @@ -49,11 +49,13 @@ static internal class AbpProjectMetadataReader private static AbpProjectMetaData ReadOrCreateMetadata(string packagePath) { - var fileContent = File.ReadAllText(packagePath); var metadata = new AbpProjectMetaData(); - using var document = JsonDocument.Parse(fileContent); + using var document = JsonDocument.Parse(fileContent, new JsonDocumentOptions + { + AllowTrailingCommas = true + }); var root = document.RootElement; if (TryGetProjectId(root,out var projectId))