当我浏览http://localhost:8004/elmah.axd时,它会显示应用程序中发生的错误,但也会生成 404 错误。我将如何停止这个 404 错误?
404错误的详细信息是:
System.Web.HttpException (0x80004005):文件不存在。
在 System.Web.StaticFileHandler.GetFileInfo(字符串 virtualPathWithPathInfo,字符串物理路径,HttpResponse 响应)
在 System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext 上下文,字符串 overrideVirtualPath)
在 System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext 上下文,AsyncCallback 回调,对象状态)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep 步骤,Boolean& completedSynchronously)
我的网络配置文件是这样的:
<配置>
<配置节>
<sectionGroup 名称="elmah" >
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
</section组>
</ configSections >
<系统.web>
< 编译调试="true" targetFramework="4.0" />
<http处理程序>
< add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</ httpHandlers >
<http模块>
< add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
</ http模块>
<身份验证模式="表单" >
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</认证>
…………
…………
</system.web>
<系统.web服务器>
< 模块 runAllManagedModulesForAllRequests="true" />
< 验证 validateIntegratedModeConfiguration="false" />
< 模块 >
< add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
</模块>
<处理程序>
< add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</ 处理程序 >
</system.webServer>
<埃尔玛>
<安全允许远程访问="0" />
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/ErrorLogs" />
</ 埃尔玛 >
</配置>