diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Configuration/ConfigReader.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Configuration/ConfigReader.cs index f010ac3a56..baf1fc79dc 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Configuration/ConfigReader.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Configuration/ConfigReader.cs @@ -18,12 +18,17 @@ namespace Volo.Abp.Cli.Configuration if (!File.Exists(settingsFilePath)) { - throw new Exception(); + throw new FileNotFoundException($"appsettings file could not be found. Path:{settingsFilePath}"); } var settingsFileContent = File.ReadAllText(settingsFilePath); - using (var document = JsonDocument.Parse(settingsFileContent)) + var documentOptions = new JsonDocumentOptions + { + CommentHandling = JsonCommentHandling.Skip + }; + + using (var document = JsonDocument.Parse(settingsFileContent,documentOptions)) { var element = document.RootElement.GetProperty("AbpCli"); var configText = element.GetRawText(); @@ -32,9 +37,11 @@ namespace Volo.Abp.Cli.Configuration Converters = { new JsonStringEnumConverter() - } + }, + ReadCommentHandling = JsonCommentHandling.Skip }; - return JsonSerializer.Deserialize(configText,options); + + return JsonSerializer.Deserialize(configText, options); } } }