asp.net – Web事件提供程序’EventLogProvider’抛出以下异常
发布时间:2020-12-16 07:04:14 所属栏目:asp.Net 来源:网络整理
导读:我无法在 Windows 2008 R2中使用新的ASP.NET 4.0应用程序在IIS 7上运行.我在事件日志中看到的只是以下错误.我似乎无法找到任何有关它意味着什么的信息,任何人都可以提供帮助吗? Log Name: ApplicationSource: ASP.NET 4.0.30319.0Date: 11/27/2011 4:22:13
我无法在
Windows 2008 R2中使用新的ASP.NET 4.0应用程序在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,Int32 index1)</Data> </EventData> </Event> 解决方法
这是因为您的代码正在尝试写入事件日志,但运行应用程序池的用户没有此权限.
您将需要更改应用程序池以作为其他用户运行,或者如果您无法更改应用程序池标识,则让您的网站模拟知名用户. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 如何在ASP.Net Core 2.0应用程序中使用Bootstrap?
- asp.net-mvc-3 – 首先使用代码禁用整数主键上的标识(自动递
- file-upload – 增加Kestrel的上传请求长度限制
- Asp.Net MVC 5 Owin Twitter Auth throwing 401 Exception
- asp.net-mvc-3 – MVC3 / Razor添加控制器“Get-PrimaryKey
- ASP.NET MVC3 Controller或Model中虚拟路径的根相对路径
- 为ASP.Net Core Weblistener安装SSL证书
- asp.net gridview中的datetime格式
- 基于B/S模式的asp课程重难点掌握情况分析系统
- 这算是ASP.NET MVC的一个大BUG吗?