After upgrade from Azure 2.0 to 2.2, CloudConfigurationManager.GetSettings("...") always returns empty

205 Views Asked by At

I upgraded my Azure from 2.0 to 2.2. After this, Microsoft.WindowsAzure.CloudConfigurationManager.GetSetting("...") always returns empty string. This code worked fine in version 2.0.

My solution does have nuGet, and I have got to latest version of windowsazure.configurationManager from here. My solution has a WebRole and a WorkerRole. The WebRole is the one I care about, and it has the following ddl versions:

Microsoft.WindowsAzure.Configuration 2.0.0.0
Microsoft.WindowsAzure.Diagnostics 2.2.0.0
Microsoft.WindowsAzure.ServiceRuntime 2.2.0.0
Microsoft.WindowsAzure.Storage 3.0.2.0
2

There are 2 best solutions below

0
On

It turns out I did not have the Azure project as the start up project! However, I was having issues with this before, and it was running in Azure.

No idea how it was sorted!

0
On

Duplicate your ServiceConfig settings in the web.config appSettings section and then you can run in the emulator or just debug the web role. GetSetting trys ServiceConfig first then looks in the web.config appSettings.