Message: Access to the registry key 'Global' is denied.
程序本地正常,部署到IIS上也正常。但是在服务器上不正常。服务器用户的权限也是管理员组。
服务器版本:SERVER2008/2012/2016/2022。报错信息如下:
System.UnauthorizedAccessException: Access to the registry key 'Global' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
at Microsoft.Win32.RegistryKey.GetValue(String name)
at System.Diagnostics.PerformanceMonitor.GetData(String item)
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CounterExists(String category, String counter, Boolean& categoryExists)
at System.Diagnostics.PerformanceCounterLib.CounterExists(String machine, String category, String counter)
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, Boolean readOnly)
1:我增加了IUSER不管用
2:权限中增加"IIS AppPool\应用程序池名" 也不管用。
3:Performance Log Users 组增加IUSER也不行。
最终处理方式:
1:将网站的应用池改为:DefaultAppPool。
2:选中应用池--高级设置--选择 NetworkService 或者Local System
然后就可以正常访问了。

非特殊说明,本文版权归 看美景 所有,转载请注明出处.
本文标题: 解决IIS的web服务获取硬件资源报错Access to the registry key 'Global' is denied