Relic Solution: Profiler Log Says "Exception thrown while attempting to parse configuration file"

This post is part of a series of posts designed to guide you through troubleshooting common issues in the .NET agent. For more context, please see the .NET Agent not reporting troubleshooting guide>.

The issue

  • The .NET agent profiler log for your application’s process contains the error message Exception thrown while attempting to parse main newrelic.config file or Exception thrown while attempting to parse configuration file.

What it means.

  • The .NET agent profiler is unable to read its main configuration file for some reason.
  • This almost always means there is a typo in your newrelic.config file that causes it not to validate.
  • For the .NET Framework agent, this file will be at C:\ProgramData\New Relic\.NET Agent\newrelic.config
  • For the .NET Core agent, this file will be in the directory where the agent was extracted on the system.

The solution

  • Validate the newrelic.config file against the newrelic.xsd file that came packaged with the agent. It should be in the same directory. There are many tools available both installed and online to validate an XML file against its XSD definitions.
  • If the formatting issue can’t be detected with the validation tool, reach out to support or ask in these forums.
1 Like