2

I'm developing an application with the ASP.NET core Framework and Visual Studio keeps coming up with the error message:

System.FormatException: "Could not parse the JSON file. Error on line number '10':*/'." JsonReaderException: Error reading JObject from JsonReader. Current JsonReader item is not an object: Comment. Path ", line 10, position 2.

The error occurs when I run the application and it tries to call the function CreateWebHostBuilder(args).Build().Run();

public class Program
{
    public static void Main(string[] args)
    {
        CreateWebHostBuilder(args).Build().Run();
    }

    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseStartup<Startup>();        
}

That's strange, because I did not modify any Json-files and when using another device (laptop for mobile developing) on the same git-commit I do not get any error messages.

Does anybody maybe know which file the error message is referring to? I would really like to fix this on this specific machine...

This is the appsettings.json file:

{
   "ConnectionStrings":{
      "DefaultConnection":"Filename=./../database_02.db"
   },
   "Logging":{
      "LogLevel":{
         "Default":"Warning"
      }
   },
   "AllowedHosts":"*"
}
jpgrassi
  • 5,482
  • 2
  • 36
  • 55
Coziac
  • 29
  • 4

0 Answers0