Error when sending or listening, Azure ServiceBus

点点圈 提交于 2019-12-11 10:45:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!