Can't get nservicebus performance counters to work in development/self host on windows server 2008 R2

StackOverflow https://stackoverflow.com/questions/18760469

  •  28-06-2022
  •  | 
  •  

Question

Get this exception when running nservicebus.host.exe self-hosting either through Visual Studio or from command prompt. (Have tried both running from command prompt as administrator and my regular user):

2013-09-12 11:16:33,978 [1] FATAL NServiceBus.Hosting.GenericHost [(null)] <(nul l)> - System.InvalidOperationException: NServiceBus performance counter for Crit ical Time not set up correctly. Please run the NServiceBus infrastructure instal lers to rectify this problem. ---> System.InvalidOperationException: Could not R ead Category Index: 9340.

I've tried running the "RunMeFirst.bat" which seems to run fine:

C:\Program Files (x86)\NServiceBus\v3.3.4>runmefirst

C:\Program Files (x86)\NServiceBus\v3.3.4>echo off 1 file(s) copied. 1 file(s) copied. 1 file(s) copied. 1 file(s) copied.

Running infrastructure installers and exiting (ignoring other command line parameters if exist). There is already a RavenDB service installed on this computer, current status:Running Starting installation of PerformanceCounters Installation of PerformanceCounters successful. Checking if MSMQ is installed. MSMQ is installed. Checking that only needed components are active. Installation is good. Checking if DTC is configured correctly.

The machine is a windows server 2008 R2 with terminal services which is a shared development server for multiple devs. I suspect the stricter security on win server is to blame here since it works on my win 7 machine.

EDIT Tried running "Install-PerformanceCounters" in Package Manager Console, but same problem. FYI, the output of Package Manager Console was (my command at the bottom):

Package Manager Console Host Version 2.2.40116.9051

Type 'get-help NuGet' to see all available NuGet commands.

Type 'get-help about_NServiceBus' to see all available NServiceBus commands. 
What if: Performing operation "Install-PerformanceCounters" on Target "DEV01". 
Performance Counters is setup and ready for use with NServiceBus 
What if: Performing operation "Install-Msmq" on Target "DEV01". 
Msmq is installed and setup for use with NServiceBus What if: 
Performing operation "Install-Dtc" on Target "DEV01". 
DTC is not properly configured 
What if: Performing operation "Install-RavenDB" on Target "DEV01".

PM> Install-PerformanceCounters 
True
PM>
Was it helpful?

OTHER TIPS

Thanks to the comment by John Simons I found the answer in this SO question: corrupted performance counters

In my particular case, running

lodctr /R

in admin command prompt was sufficient.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top