gpt4 book ai didi

asp.net-mvc - 仅在应用程序池回收后 MVC 应用程序上的 CheckVirtualFileExists 异常

转载 作者:行者123 更新时间:2023-12-05 06:44:37 26 4
gpt4 key购买 nike

在重度使用的无故障 ASP.NET MVC 3 Web 应用程序上回收应用程序池后访问任何 URL(路由)时出现以下异常。

事实:

  • IIS 7
  • .NET 4.0 经典模式应用程序池(池中只有应用程序)
  • 作为后端网络服务由其他应用程序通过 HTTPS 访问
  • 没有更改代码,网站正在接受 29 小时自动运行多年来回收相同的代码,现在自动回收禁用以保持网站正常运行
  • 应用程序池回收(或服务器重启)导致站点失败
  • 必须重新部署站点(从预编译构建中复制所有文件/文件夹进入物理路径)使其在回收后再次工作
  • 我们正在捕获/记录 Application_Error 方法中的错误
  • 事件日志中没有未处理的异常
  • 任何访问任何路由/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&amp; 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>

enter image description here

最佳答案

要调试 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!");

关于asp.net-mvc - 仅在应用程序池回收后 MVC 应用程序上的 CheckVirtualFileExists 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28348400/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com