问题
I have a client that sending and listening on a topic in Azure ServiceBus. The client is running locally on my Windows 8.1 machine. But I got following exception on SendAsync and ReceiveAsync:
A first chance exception of type 'System.InvalidOperationException' occurred in System.dll
Additional information: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
The code looks like this:
string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
var client = SubscriptionClient.CreateFromConnectionString(connectionString, topic, subscriptionId);
while(true)
{
var message = await client.ReceiveAsync();
and
string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
TopicClient client =
TopicClient.CreateFromConnectionString(connectionString, topic);
var msgToSend = new BrokeredMessage(msg);
await client.SendAsync(msgToSend);
Ang one with a solution to this problem?
回答1:
It was a firewall related issue.
来源:https://stackoverflow.com/questions/28495614/error-when-sending-or-listening-azure-servicebus