Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 我如何找到我得到“的原因?”;类型'的例外情况;System.Web.HttpUnhandledException';“被扔了吗?”;?_C#_Asp.net_.net - Fatal编程技术网

C# 我如何找到我得到“的原因?”;类型'的例外情况;System.Web.HttpUnhandledException';“被扔了吗?”;?

C# 我如何找到我得到“的原因?”;类型'的例外情况;System.Web.HttpUnhandledException';“被扔了吗?”;?,c#,asp.net,.net,C#,Asp.net,.net,我要走了 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 preser

我要走了

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)
System.Web.HttpException
执行处理程序“System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerRapper”的子请求时出错。
堆栈是
位于System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler处理程序、TextWriter编写器、Boolean preserveForm、Boolean setPreviousPage、VirtualPath路径、VirtualPath文件路径、字符串physPath、异常错误、字符串queryStringOverride)
在System.Web.HttpServerUtility.Execute(IHttpHandler处理程序、TextWriter编写器、Boolean preserveForm、Boolean setPreviousPage)
在System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler处理程序、TextWriter编写器、布尔形式)
在System.Web.Mvc.ViewPage.RenderView(ViewContext)中
在System.Web.Mvc.ViewResultBase.ExecuteSult(ControllerContext上下文)中
在System.Web.Mvc.ControllerActionInvoker.c_uuDisplayClass1C.b_uuu19()中
位于System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter筛选器、ResultExecutingContext预文本、Func`1 continuation)
位于System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext ControllerContext,IList`1 filters,ActionResult ActionResult)
位于System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext ControllerContext,String actionName)
内部例外是

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)
System.Web.HttpUnhandledException
引发了类型为“System.Web.HttpUnhandledException”的异常。
堆栈是
位于System.Web.UI.Page.HandleError(异常e)
在System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)
在System.Web.UI.Page.ProcessRequest(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)
在System.Web.UI.Page.ProcessRequest()中
在System.Web.UI.Page.ProcessRequest(HttpContext上下文)中
位于System.Web.Mvc.ViewPage.ProcessRequest(HttpContext上下文)
位于System.Web.Mvc.ViewUserControl.ViewUserControlContainerPage.ProcessRequest(HttpContext上下文)
在System.Web.Mvc.ViewPage.RenderView(ViewContext)中
位于System.Web.Mvc.ViewUserControl.RenderView(ViewContext-ViewContext)
位于System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper HtmlHelper,字符串partialViewName)
在ASP.views\u mycontroller\u myaction\u aspx.\u RendermyactionContent(HtmlTextWriter\u w,控制参数容器)
位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子对象)
在ASP.views\u shared\u my\u master.\u渲染\u控制1(HtmlTextWriter\u w,控制参数容器)
位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子对象)
位于System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter编写器,ICollection子对象)
在System.Web.Mvc.ViewPage.Render(HtmlTextWriter)上
在System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)
在System.Web.UI.Page.ProcessRequest(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)
在System.Web.UI.Page.ProcessRequest()中
在System.Web.UI.Page.ProcessRequest(HttpContext上下文)中
位于System.Web.Mvc.ViewPage.ProcessRequest(HttpContext上下文)
在System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerRapper.c_uuDisplayClass4.b_uu3()中
在System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 Func)
位于System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler处理程序、TextWriter编写器、Boolean preserveForm、Boolean setPreviousPage、VirtualPath路径、VirtualPath文件路径、字符串physPath、异常错误、字符串queryStringOverride)
我在许多其他问题中也看到过类似的情况,通常都会有一些或多或少清晰的信息,从中可以推断出问题的原因

在我的例子中,抛出了类型为“System.Web.HttpUnhandledException”的异常。


如何从该
HttpUnhandledException
中提取附加信息,以尝试查找引发该异常的原因?

结果表明,我的代码没有提取该
HttpUnhandledException
InnerException
。我抓取了IIS源代码(是的,可以正式下载),发现
System.Web.UI.Page.HandleError(异常e)
抛出
HttpUnhandledException
,并将
e
传递到其构造函数中。我希望
HttpUnhandledException
InnerException
会很有用。

您是否已将站点部署到服务器上,如果是,请转到

C:\WINDOWS \Microsoft.NET\Framework \v2.0.50727\临时ASP.NET文件并删除站点文件夹。
然后重新启动IIS。检查应用程序。

您可以将此代码添加到错误消息中:

errorMessage += "\n\n Inner Exception:\n\n" +ex.InnerException;
InnerException属性将提供有关错误的更多详细信息


我希望有帮助

这将如何帮助我找到原因?没有文件存在那里,我的朋友!这需要在服务器迁移到虚拟机时完成。那么您是如何解决这个问题的呢?你能显示一些代码吗?@frenchie只需访问
InnerException