使用Web Deploy发布后出现此错误。它没有说出它试图解析的json文件,所以我假设appsettings.json但是它们appsettings文件基本上都是来自新项目的自动生成的设置。 有没有办法更详细地了解原因?
Unhandled Exception: System.FormatException: Could not parse the JSON file. Error on line number '0': ''. ---> Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Path '', line 0, position 0.
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationFileParser.Parse(Stream input)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream)
--- End of inner exception stack trace ---
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at CFAR.Program.Main(String[] args)
答案 0 :(得分:1)
我有一个空的appsettings.production.json文件在服务器上挥之不去。在最近的网络部署之前,我没想到它已经从我的项目中删除了。
答案 1 :(得分:0)
我也遇到类似的问题 但事实证明json文件的格式不正确...缺少关闭提示