Hi,
I am trying to run my webservice which creates a performance counetr and
writes to it on Windows 2003, where the following error is returned. It runs
fine on Windows 2000.
Error:
[InvalidOperationException: Category does not exist.]
System.Diagnostics.PerformanceCounterLib.CounterExists(String machine,
String category, String counter) +283
System.Diagnostics.PerformanceCounter.Initialize() +235
System.Diagnostics.PerformanceCounter..ctor(String categoryName, String
counterName, String instanceName, Boolean readOnly) +127
System.Diagnostics.PerformanceCounter..ctor(String categoryName, String
counterName, Boolean readOnly) +21
System.Diagnostics.PerformanceCounter..ctor(String categoryName, String
counterName) +11
PCHistory.Global.SetupPerformanceCounters()
PCHistory.Global.Application_Start(Object sender, EventArgs e)
Pls help.
Martin Kulov - 08 Nov 2004 21:51 GMT
Hi LP,
I suppose that your category is not created in the performance counters at all. You should install the performance counter first by setting up installer project and use PerformanceCounterInstaller class. You should not have to leave the creation of the counter by your web service since, which is your case, it may not have sufficient rights. It did have though on Windows 2000, but due to increased security in Windows 2003 it fails.
Best,
Martin