Here is the ConfigurationSection class
using System.Configuration;
namespace CampusWebStore.Config
{
public class PoolerConfig : ConfigurationSection
{
[ConfigurationProperty("PoolId", IsRequired = true)]
public string PoolId { get; set; }
[ConfigurationProperty("Host", IsRequired = true)]
public string Host { get; set; }
[ConfigurationProperty("Port", IsRequired = true)]
public int Port { get; set; }
[ConfigurationProperty("Enabled", IsRequired = true)]
public bool Enabled { get; set; }
}
}
The web.config section definition
<section name="PoolerConfig" type="CampusWebStore.Config.PoolerConfig, CampusWebStore"/>
The actual section
<PoolerConfig
PoolId="asdf-asdf-asdf-asdf"
Host="localhost"
Port="5000"
Enabled="true"
/>
And then the line that loads it (in Global.asax.cs)
PoolerConfig poolerConfig = ConfigurationManager.GetSection("PoolerConfig") as PoolerConfig;
It seems that no matter what I do, all the properties in my PoolerConfig are default values (null strings, 0 ints, etc). Research indicates this should be easy as pie, but to no avail I cannot figure this out.