有人看过《ASP.NET Website Programming C Sharp Edition》的那个网站源码吗?我配置了半天,也没成功。
Security Exception 
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. Exception Details: System.Security.SecurityException: Requested registry access is not allowed.Source Error: 
Line 29:  if (!EventLog.SourceExists("ThePhile.COM"))
Line 30:  {
Line 31:  EventLog.CreateEventSource("ThePhile.COM", "Application");
Line 32:  }
Line 33:  EventLog.WriteEntry("ThePhile.COM", message, entryType);
 Source File: c:\wrox\thephile\philepage.cs    Line: 31 就是上面的错误,我按照fag的方法,提升了guest权限等等,还是不行,请高手帮忙。

解决方案 »

  1.   

    提升web目录 aspnet用户权限
      

  2.   

    把 EventLog.CreateEventSource 代码贴出来看看
     也许是这个方法里面操作某个目录或者文件,而没有权限,检查一下,添加aspnet用户权限
      

  3.   

    protected void LogEvent(string message, EventLogEntryType entryType)
    {
    if (!EventLog.SourceExists("ThePhile.COM"))
    {
    EventLog.CreateEventSource("ThePhile.COM", "Application");
    }
    EventLog.WriteEntry("ThePhile.COM", message, entryType);
    }.net我只看了一点点,基本什么都不懂,所以...
    哎,郁闷啦。