How to troubleshoot HTTP Error 500 30 ASP NET Core app failed to start with exception " System.IO.InvalidDataException" ?

How to troubleshoot HTTP Error 500.30 - ASP.NET Core app failed to start with below error?

"Exception Info: System.IO.InvalidDataException: Failed to load configuration from file ‘C:\Program Files (x86)\UiPath\Orchestrator\Identity\appsettings.Production.json’.
—> System.FormatException: Could not parse the JSON file.
—> System.Text.Json.JsonReaderException: ‘T’ is an invalid start of a value. LineNumber: 18 | BytePositionInLine: 17. "

Since the Issue indicates the issues with JSON structure or some character in JSON which is not expected to correct this, copy the text from Appsettings.Production.Json and follow the below procedure by copying in JSON online to validate.

Root Cause: The exception will list the line of the config that needs to be corrected along with the offending structures.

Resolution:

  1. Correct the syntax of the file. Use a JSON validator to check it like - JSON Online Validator and Formatter - JSON Lint
  2. Once the JSON structure is validated, try to correct and copy-paste the same back to Appsettings.Production.Json.
  3. Stop / Start the Site in IIS .