2013-02-12 13 views
5

DostajęJak znaleźć powód, dla którego został zgłoszony wyjątek "Wyjątek typu" System.Web.HttpUnhandledException "?

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) 

i wewnętrzny wyjątek jest

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) 

Widziałem podobne rzeczy w wielu innych kwestiach i zazwyczaj jest mniej lub bardziej jasne przesłanie, z którego przyczyną problemu może być wywnioskować.

W moim przypadku jest tylko Exception of type 'System.Web.HttpUnhandledException' was thrown.

Jak mogę wydobyć dodatkowe informacje z tego HttpUnhandledException spróbować znaleźć dlaczego został wyrzucony?

Odpowiedz

4

Okazało się, że mój kod nie wyodrębnił InnerException z tego HttpUnhandledException. Wziąłem źródła IIS (tak, mogą one być oficjalnie pobrane) i odkryłem, że System.Web.UI.Page.HandleError(Exception e) rzuca HttpUnhandledException i przekazuje e do swojego konstruktora. Spodziewam się, że InnerException z HttpUnhandledException okazuje się przydatne.

+1

Jak rozwiązałeś problem? Czy możesz pokazać kod? – frenchie

+0

@frenchie Wystarczy uzyskać dostęp do 'InnerException'. – sharptooth

-2

Czy wdrożyć swoją witrynę na serwerze, jeśli tak, to przejdź do

C: \ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files i usuń folder serwisu. , a następnie uruchom ponownie IIS. sprawdź aplikację.

+0

Jak to pomoże mi znaleźć przyczynę? – sharptooth

+0

BRAK PLIKU ISTNIEJĄ SWÓJ PRZYJACIEL! –

+0

należy to zrobić, gdy serwer jest migrowany do maszyny wirtualnej. –

0

Możesz dodać ten kod do swojej komunikatem o błędzie:

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

Obiekt InnerException daje więcej szczegółów na temat swojego błędu.

Mam nadzieję, że to pomoże!

Powiązane problemy