以下异常由web事件提供程序“EventLogProvider”抛出

时间:2021-08-25 16:03:12

I can't get a new ASP.NET 4.0 application to work on IIS 7, in Windows 2008 R2. All I can see in my event log is the below error. I can't seem to find any information about what it means, can anybody help?

我找不到新的ASP。NET 4.0应用程序在Windows 2008 R2中的IIS 7上工作。我在事件日志中看到的是下面的错误。我似乎找不到它的意思,有人能帮忙吗?

Log Name:      Application
Source:        ASP.NET 4.0.30319.0
Date:          11/27/2011 4:22:13 PM
Event ID:      1301
Task Category: Web Event
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      [myserver].[mydomain].com
Description:
The following exception was thrown by the web event provider 'EventLogProvider' in the application '/[myapp]' (in an application lifetime a maximum of one exception will be logged per provider instance):

System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
   at System.Security.Principal.WindowsIdentity.get_AuthenticationType()
   at System.Web.Management.EventLogWebEventProvider.AddWebRequestInformationDataFields(ArrayList dataFields, WebRequestInformation reqInfo)
   at System.Web.Management.EventLogWebEventProvider.ProcessEvent(WebBaseEvent eventRaised)
   at System.Web.Management.WebBaseEvent.RaiseInternal(WebBaseEvent eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1)
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ASP.NET 4.0.30319.0" />
    <EventID Qualifiers="49152">1301</EventID>
    <Level>2</Level>
    <Task>3</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2011-11-27T21:22:13.000000000Z" />
    <EventRecordID>1357</EventRecordID>
    <Channel>Application</Channel>
    <Computer>[myserver].[mydomain].com</Computer>
    <Security />
  </System>
  <EventData>
    <Data>EventLogProvider</Data>
    <Data>/[MyApp]</Data>
    <Data>System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
   at System.Security.Principal.WindowsIdentity.get_AuthenticationType()
   at System.Web.Management.EventLogWebEventProvider.AddWebRequestInformationDataFields(ArrayList dataFields, WebRequestInformation reqInfo)
   at System.Web.Management.EventLogWebEventProvider.ProcessEvent(WebBaseEvent eventRaised)
   at System.Web.Management.WebBaseEvent.RaiseInternal(WebBaseEvent eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1)</Data>
  </EventData>
</Event>

1 个解决方案

#1


6  

This is because your code is attempting to write to the event log, but the user that the application pool is running as does not have this authority.

这是因为您的代码试图写入事件日志,但是应用程序池正在运行的用户没有这个权限。

You will need to change the application pool to run as a different user or have your website impersonate a well-known user if you cannot change the app pool identity.

如果不能更改应用程序池标识,则需要更改应用程序池以作为不同的用户运行,或者让您的网站模拟知名用户。

#1


6  

This is because your code is attempting to write to the event log, but the user that the application pool is running as does not have this authority.

这是因为您的代码试图写入事件日志,但是应用程序池正在运行的用户没有这个权限。

You will need to change the application pool to run as a different user or have your website impersonate a well-known user if you cannot change the app pool identity.

如果不能更改应用程序池标识,则需要更改应用程序池以作为不同的用户运行,或者让您的网站模拟知名用户。