2011-01-05 106 views
0

因此,我們不斷收到此錯誤:錯誤在ASP.NET MVC應用程序

System.InvalidOperationException: The view 'Error' or its master was not found. The following locations were searched: 
~/Views/Indications/Error.aspx 
~/Views/Indications/Error.ascx 
~/Views/Shared/Error.aspx 
~/Views/Shared/Error.ascx 
    at System.Web.Mvc.ViewResult.FindView(ControllerContext context) 
    at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) 
    at System.Web.Mvc.Controller.ExecuteCore() 
    at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) 
    at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) 
    at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.b__4() 
    at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.b__0() 
    at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.b__7(IAsyncResult _) 
    at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End() 
    at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) 
    at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) 
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

做千頭萬緒的時候。它會隨機發生,有時會發生與我們沒有錯誤相同的事情。即使我們有時會在javascript中發現錯誤,它仍會在後端引發此錯誤。有時它也會將用戶導航到通用的「服務器錯誤」頁面。

什麼是我們可以處理這個問題並顯示一些有關問題根源的信息的方法?這個堆棧沒有顯示太多...

回答

0

您的操作方法(或控制器)是否在其上設置了[HandleError]屬性?如果是這種情況,並且你沒有Error.aspx,那麼你會看到這個錯誤。如果您刪除[HandleError]屬性,您將能夠看到實際的錯誤。

+0

嗯,你是對的。它的確如此。 – slandau 2011-01-05 21:02:41