tags:

views:

142

answers:

1

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.

+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
that's not cool at all
SpaceghostAli