I'm writing a WCF service and want to expose some custom configuration elements (e.g. Custom ConfigurationSection and ConnectionStringSettings) so that I can modify the service's configuration. One of my custom configuration elements inherits from System.Configuration.ConfigurationElementCollection. When I try to start my WCF service I g...
I've been scouring the net for the last 3 days, and can't find any reference to this question. I've created a custom configuration class to be used with my app.config. Everything works fine. The problem comes in when a configuration property (of a configuration element) is not required, and is not defined in the app.config. It seems t...
I'm wanting to put a DateTime in to the config file, however, I want the DateTime expressed in a specific way. I've seen examples of using a DateTime in a ConfigurationElement (like the example below). The examples I've seen all have the date expressed in American format. I want to ensure that date is understandable by all regardless of ...
Hi folks,
NOTE: this is very very similar to this SO question, but I need some more help.
i'm trying to make the following section in my .config file, but i get an exception when trying to access this section.
.config file
<configSections>
<section name="foos" type="Ackbar.Mvc.Models.Foo.FooCollection, Ackbar.Mvc" requirePermissi...
I have a console application that is trying to load a CustomConfigurationSection from a web.config file.
The custom configuration section has a custom configuration element that is required. This means that when I load the config section, I expect to see an exception if that config element is not present in the config. The problem is t...
I have (hopefully) setup ConfigurationElementCollection of my own design with emails as keys. Now what? Hard to find actually on the web. How do I:
iterate through it?
See if a specific element exists?
get a specific element?
...given:
YourConfigElement config =
ConfigurationManager.GetSection("YourSectionName") as YourConfi...