2013-02-12 42 views
5

Tôi nhận đượcLàm cách nào để tìm lý do tại sao tôi nhận được "Ngoại lệ loại 'System.Web.HttpUnhandledException' đã bị ném"?

System.Web.HttpException 
Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. 
Stack is 
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) 
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) 
at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) 
at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext) 
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) 
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() 
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) 
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) 
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) 

và ngoại lệ bên trong là

System.Web.HttpUnhandledException 
Exception of type 'System.Web.HttpUnhandledException' was thrown. 
Stack is 
at System.Web.UI.Page.HandleError(Exception e) 
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
at System.Web.UI.Page.ProcessRequest() 
at System.Web.UI.Page.ProcessRequest(HttpContext context) 
at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context) 
at System.Web.Mvc.ViewUserControl.ViewUserControlContainerPage.ProcessRequest(HttpContext context) 
at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext) 
at System.Web.Mvc.ViewUserControl.RenderView(ViewContext viewContext) 
at System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper htmlHelper, String partialViewName) 
at ASP.views_mycontroller_myaction_aspx.__RendermyactionContent(HtmlTextWriter __w, Control parameterContainer) 
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
at ASP.views_shared_my_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 
at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) 
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
at System.Web.UI.Page.ProcessRequest() 
at System.Web.UI.Page.ProcessRequest(HttpContext context) 
at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context) 
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3() 
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) 
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) 

Tôi đã nhìn thấy những thứ tương tự trong nhiều câu hỏi khác và thường có một số thông điệp nhiều hơn hoặc ít rõ ràng mà từ đó các vấn đề nguyên nhân có thể suy luận.

Trong trường hợp của tôi có chỉ Exception of type 'System.Web.HttpUnhandledException' was thrown.

Làm thế nào để giải nén thêm thông tin từ HttpUnhandledException đó để cố gắng tìm lý do tại sao nó được ném?

Trả lời

4

Tắt mã của tôi không giải nén InnerException của số HttpUnhandledException đó. Tôi đã nắm lấy các nguồn IIS (có, chúng có thể được tải xuống chính thức) và thấy rằng System.Web.UI.Page.HandleError(Exception e) ném HttpUnhandledException và vượt qua e vào hàm tạo của nó. Tôi hy vọng rằng InnerException của HttpUnhandledException sẽ hữu ích.

+1

Vậy bạn đã giải quyết vấn đề như thế nào? Bạn có thể hiển thị một số mã không? – frenchie

+0

@frenchie Chỉ cần truy cập 'InnerException'. – sharptooth

-2

Bạn đã triển khai trang web của bạn trên máy chủ, nếu có thì đi đến

C: \ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files và xóa thư mục trang web của bạn. sau đó khởi động lại IIS. kiểm tra ứng dụng.

+0

Điều này sẽ giúp tôi tìm ra lý do như thế nào? – sharptooth

+0

NO FILE EXIST CÓ BẠN B! CỦA TÔI! –

+0

điều này cần được thực hiện khi máy chủ được di chuyển đến máy ảo. –

0

Bạn có thể thêm mã này vào thông báo lỗi của bạn:

errorMessage += "\n\n Inner Exception:\n\n" +ex.InnerException; 

Thuộc tính InnerException sẽ cho bạn biết thêm chi tiết về lỗi của bạn.

Tôi hy vọng điều đó sẽ hữu ích!

Các vấn đề liên quan