2013-03-13 19 views
1

經過一段時間(確切的時間未確定)後,我們的MVC應用程序開始出錯並顯示以下錯誤消息和堆棧跟蹤。ASP.NET MVC2應用程序在一段時間後進入錯誤狀態

我們沒有註冊任何自定義ViewEngines ...觸摸web.config文件一段時間會清除此錯誤。

我可能會錯過什麼?

[InvalidOperationException: The property 'MasterLocationFormats' cannot be null or empty.] 
    System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String cacheKeyPrefix, Boolean useCache, String[]& searchedLocations) +697 
    System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, String masterName, Boolean useCache) +288 
    System.Web.Mvc.<>c__DisplayClass6.<FindView>b__4(IViewEngine e) +43 
    System.Web.Mvc.ViewEngineCollection.Find(Func`2 cacheLocator, Func`2 locator) +96 
    System.Web.Mvc.ViewResult.FindView(ControllerContext context) +144 
    System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +153 
    System.Web.Mvc.<>c__DisplayClass14.<InvokeActionResultWithFilters>b__11() +33 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263 
    System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +709 
    System.Web.Mvc.Controller.ExecuteCore() +162 
    System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__4() +58 
    System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375 

回答

0

一個想法可能是存儲庫實例正在被重用。確保爲存儲庫創建了新實例,該方法正在填充MasterLocationFormats屬性。

相關問題