我正在评估Windows Azure中正在处理的MVC应用程序。我刚刚移植了应用程序,并且没有任何问题地上传。大约4周后我回来上传下一个版本,现在我得到了一个异常。Windows Azure缓存cshtml文件?
来源:System.Web.WebPages 消息:节未定义:“main”。 堆栈跟踪:在System.Web.WebPages.WebPageBase.RenderSection(字符串名称,需要布尔值)ASP.Page_Views_Shared__Layout_cshtml.Execute()在e:\ sitesroot \ 0 \ Views \ Shared_Layout.cshtml:在System.Web的第77行。 System.Web.WebPages.WebPageBase.ExecutePageHierarchy()在System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext,TextWriter writer,WebPageRenderingBase startPage)在System.Web.WebPages.WebPageBase.RenderSurrounding()上的System.Web.Mvc.WebViewPage.ExecutePageHierarchy()WebPages.WebPageBase.ExecutePageHierarchy字符串partialViewName,Action`1正文)在System.Web.WebPages.WebPageBase.PopContext()在System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext上下文)在System.Web.Mvc.Async.AsyncControllerActionInvoker。 <> c_ DisplayClass25.b _22(IAsyncResult asyncResult)at System.Web.Mvc.Controller。 <> c_ DisplayClass1d.b _18(IAsyncResult asyncResult)at System.Web.Mvc.Async.AsyncResultWrapper。 <> c_ DisplayClass4.b _3(IAsyncResult ar)at System.Web.Mvc.Controls.EndExecuteCore(IAsyncResult asyncResult)at System.Web.Mvc.Async.AsyncResultWrapper。 <> c_ DisplayClass4.b _3(IAsyncResult ar)at System.Web.Mvc.MvcHandler。 <> c_ DisplayClass6。 <> c _DisplayClassb.b_ 4(IAsyncResult asyncResult)at System.Web.Mvc.Async.AsyncResultWrapper。 <>Ç _DisplayClass4.b__3(IAsyncResult的AR)在System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()在System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔& completedSynchronously)
我认为会发生这种情况的唯一原因是_layout.cshtml文件未更新,或者Home/Index.cshtml文件未更新。 MVC应用程序可以在Windows Azure模拟器中运行或在IIS中独立运行。
我已经完全删除角色并重新部署以及升级。我没有配置CDN或Azure缓存,并且可以确认自上次成功部署以来已添加到项目中的文件。
现在我的想法......
编辑:
我已经收窄的问题倒在子布局Html.RenderAction通话。我想知道这是否是我正在测试的MVC 4项目的问题。我已经加载了最新的System.Web.Mvc dll作为我的项目的一部分,但是否在Azure服务器上存在问题?
不幸的是,这并没有帮助。 – Moth 2012-04-19 08:45:54
由于该问题无法在我的身边复制,请您上传/共享SkyDrive上的测试项目吗?实际上,为了解决这个问题,我们确实需要源代码来重现问题,以便我们可以在内部调查问题。您没有必要发出完整的项目来源。我们只需要一个最简单的样本来重现问题。您可以从中删除任何机密信息或业务逻辑。然后我们可以更方便地找到问题并为您提供进一步的建议。 – 2012-04-19 13:17:42