0

I get the following exception message when I try to send a simple message with the TopicClient from the nuget package WindowsAzure.ServiceBus:

"The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly."

Here is my code:

var namespaceManager = NamespaceManager.CreateFromConnectionString("xxx");

if(!namespaceManager.TopicExists("test"))
{
    namespaceManager.CreateTopic("test");
}

var client = TopicClient.CreateFromConnectionString("xxx", "test");

var messages = data.Select(x => new BrokeredMessage(JsonConvert.SerializeObject(x))).ToArray();

await client.SendBatchAsync(messages);

I get the exception when calling SendBatchAsync.

I found this question Error when sending or listening, Azure ServiceBus, which is asking the same thing. But the resolution is not relevant for me.

I have installed this nuget package WindowsAzure.ServiceBus.PerformanceCounters (and executed the attached cmd-file) in hope that it would solve the problem, but it is still not working.

Anyone know how to solve this?

I get the same error when I try to listen to messages on the topic with the SubscriptionClient. I am runnig VS as an administrator.

Community
  • 1
  • 1
peco
  • 3,890
  • 1
  • 20
  • 27

1 Answers1

0

Solved. I had enabled that exception in the Exception Settings window (Debug > Windows > Exception Settings)

peco
  • 3,890
  • 1
  • 20
  • 27