-1

This related question has an answer which describes including/referencing additional config files from the default config file: How to read values from multiple Configuration file in c# within a single project?

Is that the only (sensible) way to do this or does C# allow me to freely access different config files? Is there something inherently special about app.config?

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

1 Answers1

1

My personal experience with Config files is that if you want to read them programatically or to add extra fields, etc, you have to work a lot. That is why I usually just create my own configuration code. It might sound as reinventing the wheel, but the configuration needs to be easily read and modified by people. Also its format might change. Depending on your config needs a simple text file or a json style config might be more accessible.

If you want to do it with .NET's method, the ConfigManager class allows you to open/change .config files, assuming you have all the elements described as classes somewhere.

Siderite Zackwehdex
  • 6,293
  • 3
  • 30
  • 46