在win2003+iis6环境下,能够正常运行,没有异常...但是在 IIS7.5环境下调用系统日志时就会出现如下错误.
应该是权限错误,但是通过增加注册表currentControlset\services\eventlog的network sevice写入权限没有效果.不知在win7下应该如何配置,求助...-----------------------------------错误如下------------------------------------------------------------安全性异常 
说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改该应用程序的信任级别。 异常详细信息: System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可访问的日志: Security。源错误: 
行 110:        protected void LogEvent(string message, EventLogEntryType entryType)
行 111:        {
行 112:            if (!EventLog.SourceExists("company.app1"))
行 113:            {
行 114:                EventLog.CreateEventSourcecompany.app1", "Application");
 

解决方案 »

  1.   

    参考下面的这篇KB已经解决了..
    http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B329291First Approach
    Create an event source under the Application event log in Registry Editor. To do this, follow these steps: 
    1.Click Start, and then click Run.
    2.In the Open text box, type regedit.
    3.Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
    4.Right-click the Application subkey, point to New, and then click Key.
    5.Type TEST for the key name.
    6.Close Registry Editor.