“Access to the registry key 'Global' is denied” when accessing performance counters

后端 未结 2 1151
半阙折子戏
半阙折子戏 2020-12-08 13:30

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.\"

I have

相关标签:
2条回答
  • 2020-12-08 13:55

    I found the solution. Whereas various links around the Internet tell you to use the identity IIS APPPOOL\DefaultAppPool, that is NOT the full story. That will only work if you are in fact assigning your applications to an app pool named "DefaultAppPool".

    This link at ServerFault has the answer. You must use the name of your app pool. In my case, the app pool's name was "staging", so the correct user was IIS APPPOOL\staging. Putting this user in the Performance Monitor Users group fixed my issue.

    0 讨论(0)
  • 2020-12-08 14:07

    In my case I added the correct Application pool (the one I used for my web site) to Performance Users and Log, but it was still giving me the issue. What I did was to

    • stop my application pool
    • switch my web site so it uses DefaultAppPool
    • restarted the web site
    • switched web site back to correct app pool (which is stopped)
    • started app pool
    • restarted the web site
    0 讨论(0)
提交回复
热议问题