在使用大量使用的无故障ASP.NET MVC 3 Web应用程序上回收App Pool后访问任何URL(路由)时,我收到以下异常。
事实:
详细说明:
HTTPErr Example: 2015-02-05 08:43:36 66.XXX.XXX.14 32224 10.XXX.XXX.185 443 HTTP/1.1 POST /IdentityToken/Endpoint.aspx - 6 Connection_Abandoned_By_ReqQueue MOBILEWEBSERVICE
Exception:
Timestamp: 2/5/2015 4:21:03 AM
Message: HandlingInstanceID: 438c9949-1ad2-49c4-9c7c-928bce03fd37
<Exception>
<Description>An exception of type 'System.Web.HttpException' occurred and was caught.</Description>
<DateTime>2015-02-05 04:21:03Z</DateTime>
<ExceptionType>System.Web.HttpException, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</ExceptionType>
<Message>The file '/Policies/Endpoint.aspx' does not exist.</Message>
<Source>System.Web</Source>
<HelpLink />
<Property name="WebEventCode">0</Property>
<Property name="ErrorCode">-2147467259</Property>
<Property name="Data">System.Collections.ListDictionaryInternal</Property>
<Property name="TargetSite">Void CheckVirtualFileExists(System.Web.VirtualPath)</Property>
<Property name="HResult">-2147467259</Property>
<StackTrace> at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)</StackTrace>
<additionalInfo>
<info name="MachineName" value="SERVERNAME" />
<info name="TimeStamp" value="2/5/2015 9:21:03 AM" />
<info name="FullName" value="Legacy, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null" />
<info name="AppDomainName" value="/LM/W3SVC/6/ROOT-1-130676015007079933" />
<info name="ThreadIdentity" value="" />
<info name="WindowsIdentity" value="IIS APPPOOL\MOBILEWEBSERVICE" />
</additionalInfo>
</Exception>
答案 0 :(得分:1)
要调试CheckFileExists
,您可能想要使用以下内容:
string fileName = "Test.aspx";
bool IsExistFile = System.IO.File.Exists(Server.MapPath("./") + fileName);
if (IsExistFile)
Response.Write("Find the file!");
else Response.Write("The file is not exist!");