0

I have added a link to my app.config file to my unit test project and it works, I can see the config values listed. However when I add a custom section as discussed here (How to get the values of a ConfigurationSection of type NameValueSectionHandler) to my XML, ConfigurationManager shows as being in an invalid state in the debugger.

My app.config ends like this: enter image description here

MSDN says we're not supposed to use the older pre .NET 2 config classes as they are deprecated. So I'm not sure what can be wrong here?

Community
  • 1
  • 1
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589

1 Answers1

0

Aha... I had thought no errors were being logged but found this was being reported which clears it up:

System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Only one element allowed per config file and if present must be the first child of the root element.

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589