I have an Azure web role and I want to store some settings in web.config under <appSettings>
tag. Yes, I'm aware of service configuration files, yet I have reasons to prefer web.config.
When I execute (from here):
System.Configuration.Configuration rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(null);
if (rootWebConfig1.AppSettings.Settings.Count > 0) {
}
settings count is always zero although I've added a key-value pair under <appSettings>
.
What am I doing wrong? Is it possible to read settings from web.config from inside web role entry point?