Should be simple, but whatever I try returns null:
const string key = "system.web";
var sectionTry1 = WebConfigurationManager.GetSection(key);
var sectionTry2 = ConfigurationManager.GetSection(key);
I'm sure I have done this before.
I am using MVC if this makes a difference.
This worked for me:
Was being an idiot - system.web is not a config section but a config group. If I change the key to an actual section, then both methods work fine. Here's the one using ConfigurationManager:
I think accessing system.web is slightly different to accessing appSettings.
Try this:
You need to cast the relevant section of system.web you're trying to access to a particular type.