Web应用程序的事件日志SecurityException? [英] Event Log SecurityException for Web Application?

查看:88
本文介绍了Web应用程序的事件日志SecurityException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将消息写入事件日志的应用程序。我传递给EventLog.WriteEntry的源不存在,因此框架尝试通过将其添加到注册表来创建源。如果用户是管理员,则工作正常,我得到以下信息,而该用户不是管理员:

I have an app that writes messages to the event log. The source I'm passing in to EventLog.WriteEntry does not exist, so the Framework tries to create the source by adding it to the registry. It works fine if the user is an Admin by I get the following whe the user is not an admin:

System.Security.SecurityException:不允许请求的注册表访问。信息。

"System.Security.SecurityException : Requested registry access is not allowed." message.

我该如何解决?

更新

我已经使用注册表中的Admin帐户手动创建了注册表。现在,我出现了错误:System.Security.SecurityException:不允许请求的注册表访问。

I have create the registry with the Admin account manually in the registry. Now, I have the error : System.Security.SecurityException: Requested registry access is not allowed.

我不理解,因为我在组管理员中创建了一个用户。 ..我需要做些什么?

I do not understand because I have create a user in the Group Administrator... what do I have to do more?

推荐答案

对于您的更新,我发现了一些可能对您有所帮助的东西:

For your update I have found something that might help you :

Run regedt32
Navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security
Right click on this entry and select Permissions
Add the ASPNET user
Give it Read permission

2. Change settings in machine.config file

Run Explorer
Navigate to WINDOWS or WINNT folder
Open Microsoft.NET folder
Open Framework folder
Open v1.1.4322 folder (folder name may be different, depending on what dotnet version is installed)
Open CONFIG folder
Open machine.config file using notepad (make a backup of this file first)
Locate processmodel tag (approx. at line 441)
Locate userName="machine" (approx. at line 452)
Change it to userName="SYSTEM"
Save and close the file
Close Explorer

3. Restart IIS

Run IISReset

< a href = http://forums.codecharge.com/posts.php?post_id=67135 rel = nofollow noreferrer>源在此处

这篇关于Web应用程序的事件日志SecurityException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆