C#发布部署到服务器后,不允许所请求的注册表访问权。

时间:2021-08-23 13:10:08
在服务器事件查看器下面发现这个错误:

事件 ID ( 1334 )的描述(在资源( ASP.NET 2.0.50727.0 )中)无法找到。本地计算机可能没有必要的注册信息或消息 DLL 文件来从远程计算机显示消息。您可能可以使用 /AUXSOURCE= 标识来检索词描述;查看帮助和支持以了解详细信息。下列信息是事件的一部分: An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/Root/SG

Process ID: 2068

Exception: System.Security.SecurityException

Message: 不允许所请求的注册表访问权。

StackTrace:    在 System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
   在 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
   在 System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData)
   在 System.Diagnostics.EventLog.CreateEventSource(String source, String logName)
   在 Epower.DevBase.BaseTools.EventTool.EventLog(String Message) 位置 F:\HYLDevolopePrj\web20120115\Epower.ITSM\Epower.DevBase.BaseTools\EventTool.cs:行号 56
   在 Epower.DevBase.BaseTools.MailToolAgent.DoAction() 位置 F:\HYLDevolopePrj\web20120115\Epower.ITSM\Epower.DevBase.BaseTools\MailTool.cs:行号 64
   在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   在 System.Threading.ExecutionContext.runTryCode(Object userData)
   在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ThreadHelper.ThreadStart().

4 个解决方案

#1


引用楼主 education520 的回复:
Message: 不允许所请求的注册表访问权。

很清楚的错误信息。
修改程序,不进行注册表访问就可以了。

#2


和服务器管理员联系。

#3


开权限

#4


能说具体点吗?我在网上试了好多方法都不行

#1


引用楼主 education520 的回复:
Message: 不允许所请求的注册表访问权。

很清楚的错误信息。
修改程序,不进行注册表访问就可以了。

#2


和服务器管理员联系。

#3


开权限

#4


能说具体点吗?我在网上试了好多方法都不行