发送或侦听时出错,Azure ServiceBus
Error when sending or listening, Azure ServiceBus
我有一个客户端发送和侦听 Azure ServiceBus 中的主题。客户端在我的 Windows 8.1 机器上本地 运行。但是我在 SendAsync 和 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.
代码如下所示:
string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
var client = SubscriptionClient.CreateFromConnectionString(connectionString, topic, subscriptionId);
while(true)
{
var message = await client.ReceiveAsync();
和
string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
TopicClient client =
TopicClient.CreateFromConnectionString(connectionString, topic);
var msgToSend = new BrokeredMessage(msg);
await client.SendAsync(msgToSend);
有解决这个问题的方法吗?
这是一个与防火墙相关的问题。
我有一个客户端发送和侦听 Azure ServiceBus 中的主题。客户端在我的 Windows 8.1 机器上本地 运行。但是我在 SendAsync 和 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.
代码如下所示:
string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
var client = SubscriptionClient.CreateFromConnectionString(connectionString, topic, subscriptionId);
while(true)
{
var message = await client.ReceiveAsync();
和
string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
TopicClient client =
TopicClient.CreateFromConnectionString(connectionString, topic);
var msgToSend = new BrokeredMessage(msg);
await client.SendAsync(msgToSend);
有解决这个问题的方法吗?
这是一个与防火墙相关的问题。