title: Can't get Performance Counter Instance Names using C#
body: <p>I am trying to get a list of all performance counter instance names on the local machine for a named Category. When I call the static <code>GetCategories()</code> method or construct my own instance of the <code>PerformanceCounterCategory</code> class and call <code>GetInstanceNames()</code> the process just hangs and they never return.</p>
  
  <p>for example:</p>
  
  <p><code>var categories = System.Diagnostics.PerformanceCounterCategory.GetCategories()</code></p>
  
  <p>or</p>
  
  <pre><code>var categoryStruct = new PerformanceCounterCategory("the name");
  var instances = categoryStruct.GetInstanceNames();
  </code></pre>
  
  <p>Does anyone have an idea of what is happening here, or maybe there is another method I can use to get this information.</p>
  
  <p>For context, I am running VS 2013 as administrator when performing this test. Also, I can perform all other functions related to counters with no problem (<em>e.g. read values, set values, etc...</em>), the issue only comes up in relation to the above calls.</p>