解决EP拒绝访问注册表Global键的的问题
问题描述
打开EP站点时出现如下Error:
Message: An unhandled error has occurred. To view details about this error, enable debugging in the web.config file or view the Windows event logs.
Source: mscorlib
Exception details:
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.CategoryExists(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
at Microsoft.Dynamics.AX.ManagedInterop.RuntimeContext.InitializePerformanceCounters(String categoryName)
at Microsoft.Dynamics.Framework.BusinessConnector.PerformanceCounters..cctor()
本文地址:http://www.cnblogs.com/Interkey/p/Access-to-the-registry-key-Global-is-denied.html
问题分析
从Exception Details 中可以得知 Exception 是在PerformanceCounters读取这个注册表key时没有相应权限而抛出的。
解决思路
授予 PerformanceCounters 对应的服务相应的权限。
解决方案
1、 因为我们这边没有权限来处理,而对方那边的操作是将安装部署的自定义用户 Service Account 加入到 Administrators用户组。
结果是:上述问题临时解决,但过段时间后依然出现上述问题。我方联系人因为以前有遇到过用户加入到Administrators用户组过段时间后用户又不在这个组的情况据此猜测对方也是遇到了这种情况,但具体情况未知。
2、 经过搜索找到了同样问题的解决方案[Message: Access to the registry key 'Global' is denied],不过是英文的,在实际操作中一时还不好理解上述的描述。故此翻译成中文并加以解释:
a) 打开Computer Management - System Tools - Local Users and Groups - Groups - Performance Log Users.
b) 添加 Identity 到Performance Log Users 组。难点在于得到正确的Identity。检查应用程序池的 Identity。如果使用的是ApplicationPoolIdentity,请继续下面的步骤。
c) 无需添加一个本地用户。因为ApplicationPoolIdentity 并不是一个实际存在的用户,所以要添加到Performance Log Users 组需要使用如下形式:IIS AppPool\AppPoolName (其中AppPoolName 是应用程序池名,例如:IIS AppPool\AX2012)。
d) 为了使更改生效,需要重启IIS或者停止再启动相应用应用程序池。回收相应应用程序池不会使更改生效。
步骤b使用的是ApplicationPoolIdentity,如果使用本地用户,则直接将此用户添加到Performance Log Users 组,但因为没有相应的权限,所以无法进行测试。
至于将用户添加到Administrators用户组过段时间后失效,暂时无法跟进。
本文地址:http://www.cnblogs.com/Interkey/p/Access-to-the-registry-key-Global-is-denied.html
Here is a link for more information about Application Pool Identities.
总结
问题的本质是赋予权限以让PerformanceCounters有读取相应注册表的权限。但方案1是直接将权限添加到管理员组,方案2是将相应的用户添加到Performance Log Users 组,因为此用户是虚拟用户,所以要按一定的格式添加。本质上还是授权。
其他
来这里以后感觉快要变成了技术支持了,工作内容与预期偏差甚远,所用技术为AX 2012 和 SharePoint 2010,而且主要工作内容为解决技术问题而非开发,.NET编程几乎没有,由于对业务还不熟悉,所以X++的编写也没有。感觉有些偏离方向了(拿手的可是C#,现阶段以开发为主),当然好处也有:规范化和时间自由。不过既然来了,肯定要把它做好!
本文地址:http://www.cnblogs.com/Interkey/p/Access-to-the-registry-key-Global-is-denied.html
作者:Cosmic_Spy
出处:http://www.cnblogs.com/Interkey/
有兴趣可以加群【.NET破解|反编译】请注明:博客园,谢谢~
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则肯定是你抄我的。
posted on 2015-04-01 17:35 Cosmic_Spy 阅读(1562) 评论(1) 编辑 收藏 举报
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
· 零经验选手,Compose 一天开发一款小游戏!