azureazure-configuration

Why is CloudConfigurationManager using my Cloud.cscfg instead of Local.cscfg?


I have configured my application to use the Service configuration Local in the development settings.

I have two cscfg files (as per default) Cloud and Local. I have added connection strings for Storage that tell it to use a live account in Cloud.cscfg and dev storage for Local.cscfg.

However when I run my project and use the line

var setting = CloudConfigurationManager.GetSetting("StorageConnectionString");

It is using my Cloud configuration and returning my live storage. It is definitely my Cloud cscfg and not something else setting the value as if I change it in Cloud the setting returned changes.

Is this by design? Is there any way to see the logic CloudConfigurationManager is using to select the configuration?

The weird thing was I am sure this was working earlier.


Solution

  • Deleted all compiled versions of projects. Restarted Compute and Development storage services and the issue went away.