title: "Access to the registry key 'Global' is denied" when accessing performance counters
body: <p>I'm attempting to read some performance counters from my ASP.NET application. When I do, I get the error "Access to the registry key 'Global' is denied."</p>
  
  <p>I have tried following the instructions <a href="http://blogs.msdn.com/b/bclteam/archive/2006/09/08/746900.aspx" rel="noreferrer">here</a> and <a href="https://stackoverflow.com/questions/2865999/access-to-the-registry-key-global-is-denied">here</a>, using the user <code>IIS AppPool\DefaultAppPool</code>, which is the identity my app pool is configured to use:</p>
  
  <p><img src="https://i.stack.imgur.com/VEHHp.png" alt="Screenshot of App Pool configuration"></p>
  
  <p>I have added that user to the Performance Monitor Users group:</p>
  
  <p><img src="https://i.stack.imgur.com/nJL0Q.png" alt="enter image description here"></p>
  
  <p>And after adding the user, I restarted my computer. But I am still getting the error.</p>
  
  <p>I have also tried adding the users IUSR and NETWORK SERVICE to the Performance Monitor Users group, but those don't work either. Out of desperation, I tried adding the user "Everyone" to the Performance Monitor Users group, and that actually does work. But my goal is to log statistics from my application in production, and I don't want to add "Everyone" to that group on the production server.</p>
  
  <p>What else needs to happen in order to read the performance counters without generating a security exception?</p>