Azure应用服务视图尚未预编译错误

时间:2018-11-16 11:38:41

标签: c# asp.net-mvc iis azure-web-sites

我们有一个多实例Azure应用程序服务,该应用程序托管具有预编译视图的IIS .net MVC应用程序。 我们偶尔会开始遇到这些错误(值得一提的是不在部署时出现),我们的视图没有预先编译。 错误开始随时间传播到所有视图,从而使我们的实例变得不稳定并且无法处理任何请求。 最初,我们怀疑第三方javascript渲染dll无法正确回收,并且未释放锁,但我们将其删除,问题仍然存在。 在进行进一步调查时,似乎我们的问题发生在IIS扩大/缩小应用程序域时,作为内部资源管理例程的一部分,但是我们仍然无法深入了解这一问题。

如果有什么帮助的话,一个例外:

    The file '/Views/MakeModelYear/_Tooltip.cshtml' has not been pre-compiled, and cannot be requested. 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.GetCompiledType(VirtualPath virtualPath)
   at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
   at System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper htmlHelper, String partialViewName, Object model)
   at ASP._Page_Views_Search_Results_cshtml.<Execute>b__3()
   at System.Web.WebPages.WebPageBase.<>c__DisplayClass42_0.<RenderSection>b__0(TextWriter tw)
   at System.Web.WebPages.WebPageBase.Write(HelperResult result)
   at ASP._Page_Views_Shared__Layout_cshtml.Execute()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.WebPages.WebPageBase.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer)
   at System.Web.WebPages.WebPageBase.Write(HelperResult result)
   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
   at System.Web.WebPages.WebPageBase.PopContext()
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult asyncResult)

已经进行了一些优化,例如启用了天蓝色缓存,以使我们免受瞬态存储问题的困扰。

1 个答案:

答案 0 :(得分:0)

我们遇到了类似的问题,导致了相同的症状。 网站发布后运行正常,然后运行正常的页面突然开始出错,并带有上面包含的消息。 您可以进行测试以确保服务器的防病毒不是罪魁祸首。我们考虑过将网站和“临时网点文件”添加到AV控制台的“要排除的文件夹”列表中,但是这样做显然存在风险。 我们还从bin文件夹中删除了所有不需要的文件,例如几个备份zip文件。