asp.net core下使用PerformanceCounter监控网站内存占用,exe方式运行没问题,但是发布到iis出现了Access to the registry key 'Global' is denied.
错误
解决
修改应用程序池的程序标识,改为LocalSystem
路径:应用程序池–>选中应用–>高级设置–>进程模型—>标识—>选择LocalSystem
参考
https://blog.csdn.net/u011511086/article/details/135202377
https://stackoverflow.com/questions/17301640/access-to-the-registry-key-global-is-denied-when-accessing-performance-count