I am trying to make a windows application in WPF that needs to send messages to Azure queue that belongs to other cloud application. Later a worker role will extract those messages from the queue and make some manipulation on the data.
edit: this is my code, I included this:
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
using Microsoft.WindowsAzure.ServiceRuntime;
var storageAccount = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
var queue = storageAccount.CreateCloudQueueClient();
I get this exception:
SetConfigurationSettingPublisher needs to be called before FromConfigurationSetting can be used
I've tried to look up this exception but didn't find a normal solution. Every post is talking about an azure cloud application while I'm trying to do it from WPF.
I managed to make it work, with some help from a friend. This is what I did:
Added reference to System.Configuration
in order to use ConfigurationManager
Added to the App.Config:
<appSettings>
<add key="StorageConnectionString" value="UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://127.0.0.1:10001/"/>
</appSettings>
In order to connect to local storage account:
CloudStorageAccount st = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"].ToString());
Hopes it helps other stuck with same problem!