System.Security.SecurityException写入事件日志时 [英] System.Security.SecurityException when writing to Event Log

查看:353
本文介绍了System.Security.SecurityException写入事件日志时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图从端口2003服务器(和IIS6)一个ASP.NET应用程序到Windows Server 2008(IIS7)。

I’m working on trying to port an ASP.NET app from Server 2003 (and IIS6) to Server 2008 (IIS7).

当我尝试并参观浏览器我得到这个页面:

When I try and visit the page on the browser I get this:

中的服务器错误'/'应用。

Server Error in ‘/’ Application.

安全例外

说明:应用程序试图执行不是由安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系或更改配置文件中的应用程序的信任级别。

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application’s trust level in the configuration file.

异常详细信息:System.Security.SecurityException:源未找到,但一些或所有事件日志不能被搜索到。不可访问的日志:安全性

Exception Details: System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

源错误:

当前Web请求的执行过程中生成了未处理的异常。可以使用异常堆栈跟踪下面确定有关起源和异常的位置信息。

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and the location of the exception can be identified using the exception stack trace below.

堆栈跟踪:

[SecurityException异常:源未找到,但一些或所有事件日志不能被搜索到。不可访问的日志:安全]

[SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.]

System.Diagnostics.EventLog.FindSourceRegistration(源字符串,字符串计算机名,布尔只读)562
  System.Diagnostics.EventLog.SourceExists(源字符串,字符串机器名)+251

System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) +562 System.Diagnostics.EventLog.SourceExists(String source, String machineName) +251

[剪断]

以上是我对我所做的尝试和解决的事情:

These are the things I’ve done to try and solve it:


  1. 使每个人完全访问权限的关键 HKEY_LOCAL_MACHINE \\系统\\ CurrentControlSet \\服务\\事件日志\\安全。这个工作。但是,我自然不能在生产中做到这一点。所以我删除了所有人的权限运行几分钟的应用程序和错误出现再后。

  1. Give "Everyone" full access permission to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Security. This worked. But naturally I can’t do this in production. So I deleted the "Everyone" permission after running the app for a few minutes and the error re-appeared.

我创建的应用程序日志和安全日志中源(和我验证它通过注册表编辑器存在)安装使用提升的权限时,但错误依然存在。

I created the source in the Application log and the Security log (and I verified it exists via regedit) during installation with elevated permissions but the error remained.

我给应用程序中的的web.config 文件完全信任级别(使用 Appcmd.exe的),但无济于事。

I gave the app a full trust level in the web.config file (and using appcmd.exe) but to no avail.

有没有人有洞察力,以什么可以在这里完成?

Does anyone have an insight as to what could be done here?

PS:这是一个跟进这个<一个href=\"http://stackoverflow.com/questions/1261919/problem-in-accessing-writing-to-eventlog/1261960#1261960\">question.我跟着给定的答案,但无济于事(见上#2)。

PS: This is a follow up to this question. I followed the given answers but to no avail (see #2 above).

推荐答案

解决的办法是让网络服务的事件日志/安全密钥读取权限

The solution was to give NetworkService read permission on the EventLog/Security key

这篇关于System.Security.SecurityException写入事件日志时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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