I have created a multi-instance performance counter and I pass it mixed case instance names but somehow the instance names get converted to lower case when I view them both through code and in perfmon. Does anyone know how to prevent this? Found this on google, thought it was nice of Luke Zhang to never follow up.
views:
142answers:
1
+1
Q:
How do I stop custom performance counter instance names from being auto converted to lower case
+1
A:
I used Reflector to look at the code in System.dll for the PerformanceCounter. In the private Initialize event is this little nugget:
this.sharedCounter = new SharedPerformanceCounter(categoryName.ToLower(CultureInfo.InvariantCulture), this.counterName.ToLower(CultureInfo.InvariantCulture), this.instanceName.ToLower(CultureInfo.InvariantCulture), this.instanceLifetime);
I think that's why.
Alan McBee
2009-06-27 01:13:34
that's not cool at all
SpaceghostAli
2009-07-03 19:33:07