custom-configuration

Migrate Custom ConfigSection in C#

Hello from a long time lurker, first time poster. I am working on a C# app with a custom config section to save ftp account information. When I come out with a new revision, all the information saved in the previous release is gone. I've tried using Properties.Settings.Default.Upgrade(), but that only updates usersettings and not custo...

Moving a custom configuration group to a separate file

I've recently wrote a rather large custom configuration group. I'm curious if it is possible to move this configuration to a separate file via the following: <configuration> <configSections> <sectionGroup name="MyCustomGroup"> <section name="MyCustomSection"/> </sectionGroup> </configSections> <MyCustomGroup ...

ConfigurationErrorsException in a console app

The entry 'MyCustomElement' has already been added. C:\Projects\Sandbox\Sandbox.Console\bin\Debug\Sandbox.Console.vshost.exe.config line 52 I'm a bit stumped on this one. This console app has had quite a few custom config sections added over the past few weeks with no issue. We've run the app for some time and just recently(within the...

ConfigurationManager.GetSection returning null for appparently correct 'path'

This is regarding a web.config file Here's the ConfigSection <configSections> <sectionGroup name="HttpExceptionHandler"> <section name="errorLog" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="errorMail" type="System.Configuration.S...

When is using the <appSettings> section preferable to a custom configuration section?

When creating my application's or library's configuration, I generally prefer using a custom configuration section over the <appSettings> section for the following reasons. Framework serialization to a user-defined configuration object; each config value has an appropriate type Configuration values may be validated against type and val...