未找到文件 - 但是,没有文件中指定
问题描述:
可能重复:
How to solve exception “File does not exist”?未找到文件 - 但是,没有文件中指定
我的Asp.NET Web应用程序引发错误。错误的日期和时间似乎不对应于加载页面的日期和时间。
我正在使用一个自定义错误页面,但据我所知,这不是正在显示。
这里是web.config中的部分的customErrors:
<customErrors mode="On" defaultRedirect="~/WebForms/ErrorPage.aspx">
<error statusCode="404" redirect="~/WebForms/ErrorPageNotFound.aspx" />
</customErrors>
完整的错误和堆栈跟踪如下:
06/08/2012 01:15:25 - Error File does not exist.
at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response)
at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath)
at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
正如你可以看到它说文件不存在,但不告诉我哪个文件。如果有人能够对此有所了解并指出开始寻找的方向,我将不胜感激。
答
正如我在评论中指出的那样,这是一个重复的问题。
该错误是由于我的网站根目录中并不存在favicon.ico
的请求而导致的。
我怀疑我的网站被一个搜索引擎蜘蛛或者类似的东西拖网,这就是为什么错误发生在奇怪的时候。
更新:有与robots.txt
你什么时候得到这个错误的请求,这个昨晚的另一个发生?当你去到你的网站的根? ('/')? – Jacob 2012-08-06 07:59:33
当您的应用出现异常并且asp.net尝试查找错误页面时,可能会发生这种情况。你可以在你设置的地方添加web.config代码吗? – 2012-08-06 08:00:56
相关讨论:http://*.com/questions/3705057/how-to-solve-exception-file-does-not-exist – adatapost 2012-08-06 08:02:01