Reputation: 7048
I copied a "*.settings" file from a project to another in a solution, but doing so does not update the "app.config" file the way it would if I had added the settings using the "Add Item" dialog.
The application builds fine, but in runtime it throws the following exception when trying to access the configuration class:
System.Configration.ConfigurationErrorsException: Configuration system failed to initialize InnerException: Unrecognized configuration section
Upvotes: 1
Views: 396
Reputation: 7048
The solution was fairly simple: just modify the ".settings" using the designer (add a setting, or modify an existing one) and save it. When it is saved, VS will automatically try to update the "app.config" file of the project it belongs to, and if the corresponding configuration section does not exist VS will create it.
If the exception keeps being raised, just look for the configuration file indicated in the exception message and delete it.
Upvotes: 1