【问题标题】:Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'执行处理程序“System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper”的子请求时出错
【发布时间】:2013-08-27 12:11:47
【问题描述】:

我收到以下错误:

执行处理程序的子请求时出错,

System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper

一行

<li>@{Html.RenderAction("CartSummary", "ShoppingCart");}</li>

以上代码在Shared/_Layout.cshtml

<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")"
rel="stylesheet" 
        type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")"
        type="text/javascript"></script>
</head>
<body>
    <div id="header">
        <h1><a href="/">ASP.NET MVC MUSIC
STORE</a></h1>
        <ul id="navlist">
            <li class="first">
                <a href="@Url.Content("~")" id="current">
                    Home</a></li>
            <li><a href="@Url.Content("~/Store/")">Store</a></li>
           <li>@{Html.RenderAction("CartSummary", "ShoppingCart");}</li>
            <li><a href="@Url.Content("~/StoreManager/")">
                    Admin</a></li>
        </ul>        
    </div>
    @{Html.RenderAction("GenreMenu", "Store");}
    <div id="main">
        @RenderBody()
    </div>
    <div id="footer">
        built with <a href="http://asp.net/mvc">ASP.NET MVC 3</a>
    </div>
</body>
</html>


CartSummary 操作:

/ GET: /ShoppingCart/CartSummary 
[ChildActionOnly] 
public ActionResult CartSummary() 
{ 
    var cart = ShoppingCart.GetCart(this.HttpContext); 
    ViewData["CartCount"] = cart.GetCount(); 
    return PartialView("CartSummary"); 
}

更多说明

System.Web.HttpException was unhandled by user code
  HResult=-2147467259
  Message=Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
  Source=System.Web
  ErrorCode=-2147467259
  WebEventCode=0
  StackTrace:
       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.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
       at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
       at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
       at System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName)
       at ASP._Page_Views_Shared__Layout_cshtml.Execute() in d:\DIL\IT\ASP.NET\MvcMusicStore2\MvcMusicStore2\Views\Shared\_Layout.cshtml:line 20
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
       at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
       at System.Web.WebPages.WebPageBase.Write(HelperResult result)
       at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
       at System.Web.WebPages.WebPageBase.PopContext()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
       at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
  InnerException: System.Web.HttpCompileException
       HResult=-2147467259
       Message=d:\DIL\IT\ASP.NET\MvcMusicStore2\MvcMusicStore2\Views\ShoppingCart\CartSummary.cshtml(4): error CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
       Source=System.Web
       ErrorCode=-2147467259
       WebEventCode=0
       SourceCode=#pragma checksum "D:\DIL\IT\ASP.NET\MvcMusicStore2\MvcMusicStore2\Views\ShoppingCart\CartSummary.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "8F2BBF58AF78F990CB91A0CC0496EC7C5799E25F"
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.17929
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace ASP {
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Web;
    using System.Web.Helpers;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.WebPages;
    using System.Web.Mvc;
    using System.Web.Mvc.Ajax;
    using System.Web.Mvc.Html;
    using System.Web.Routing;


    public class _Page_Views_ShoppingCart_CartSummary_cshtml : System.Web.Mvc.WebViewPage<dynamic> {

#line hidden


        public _Page_Views_ShoppingCart_CartSummary_cshtml() {
        }

        protected ASP.global_asax ApplicationInstance {
            get {
                return ((ASP.global_asax)(Context.ApplicationInstance));
            }
        }

        public override void Execute() {


            #line 1 "D:\DIL\IT\ASP.NET\MvcMusicStore2\MvcMusicStore2\Views\ShoppingCart\CartSummary.cshtml"
Write(Html.ActionLink("Cart (" + ViewData["CartCount"] + ")",    "Index",    "ShoppingCart",
    new { id = "cart-status" }));


            #line default
            #line hidden
WriteLiteral("\r\n\r\n    ");



            #line 4 "D:\DIL\IT\ASP.NET\MvcMusicStore2\MvcMusicStore2\Views\ShoppingCart\CartSummary.cshtml"
Write(Html.RenderAction("CartSummary", "ShoppingCart"));


            #line default
            #line hidden
WriteLiteral(";\r\n");


        }
    }
}

       StackTrace:
            at System.Web.Compilation.AssemblyBuilder.Compile()
            at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
            at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
            at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
            at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
            at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
            at System.Web.Compilation.BuildManager.GetObjectFactory(String virtualPath, Boolean throwIfNotFound)
            at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String virtualPath)
            at System.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext controllerContext, String virtualPath)
            at System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List`1 locations, String name, String controllerName, String areaName, String cacheKey, String[]& searchedLocations)
            at System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext controllerContext, String[] locations, String[] areaLocations, String locationsPropertyName, String name, String controllerName, String cacheKeyPrefix, Boolean useCache, String[]& searchedLocations)
            at System.Web.Mvc.VirtualPathProviderViewEngine.FindPartialView(ControllerContext controllerContext, String partialViewName, Boolean useCache)
            at System.Web.Mvc.ViewEngineCollection.<>c__DisplayClass8.<FindPartialView>b__7(IViewEngine e)
            at System.Web.Mvc.ViewEngineCollection.Find(Func`2 lookup, Boolean trackSearchedPaths)
            at System.Web.Mvc.ViewEngineCollection.FindPartialView(ControllerContext controllerContext, String partialViewName)
            at System.Web.Mvc.PartialViewResult.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.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19()
            at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
            at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b()
            at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, 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__DisplayClass6.<>c__DisplayClassb.<BeginProcessRequest>b__5()
            at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
            at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
            at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
            at System.Web.Mvc.MvcHandler.<>c__DisplayClasse.<EndProcessRequest>b__d()
            at System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f)
            at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action)
            at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
            at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
            at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerAsyncWrapper.<>c__DisplayClassa.<EndProcessRequest>b__9()
            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.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap(Action action)
            at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerAsyncWrapper.EndProcessRequest(IAsyncResult result)
            at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
       InnerException: 



我收到与此问题相关的另一个错误。我将其放在下面

我添加了这一行,这是在CartSummery.cshtml

@Html.ActionLink("Cart (" + ViewData["CartCount"] + ")",    "Index", 
                         "ShoppingCart", new { id = "cart-status" })

@Html.RenderAction("CartSummary", "ShoppingCart");

但我有以下错误:

C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Routing\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Routing.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\Users\W8\AppData\Local\Temp\Temporary ASP.NET Files\root\c147d7a5\1dbddebf\App_global.asax.nsxenzgx.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Abstractions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Abstractions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Mvc\v4.0_3.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Deployment.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Helpers\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.Helpers.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Users\W8\AppData\Local\Temp\Temporary ASP.NET Files\root\c147d7a5\1dbddebf\assembly\dl3\8a78b80f\5b89d8d7_19a3ce01\MvcMusicStore2.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Users\W8\AppData\Local\Temp\Temporary ASP.NET Files\root\c147d7a5\1dbddebf\assembly\dl3\6c65bdb8\282840f1_e09fce01\EntityFramework.dll" /out:"C:\Users\W8\AppData\Local\Temp\Temporary ASP.NET Files\root\c147d7a5\1dbddebf\App_Web_cartsummary.cshtml.fd8dc0e0.sp2ioc_m.dll" /D:DEBUG /debug+ /optimize- /w:4 /nowarn:1659;1699;1701;612;618 /warnaserror-  "C:\Users\W8\AppData\Local\Temp\Temporary ASP.NET Files\root\c147d7a5\1dbddebf\App_Web_cartsummary.cshtml.fd8dc0e0.sp2ioc_m.0.cs" "C:\Users\W8\AppData\Local\Temp\Temporary ASP.NET Files\root\c147d7a5\1dbddebf\App_Web_cartsummary.cshtml.fd8dc0e0.sp2ioc_m.1.cs"


Microsoft (R) Visual C# Compiler version 4.0.30319.17929

for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.

d:\DIL\IT\ASP.NET\MvcMusicStore2\MvcMusicStore2\Views\ShoppingCart\CartSummary.cshtml(3,1): error CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
d:\DIL\IT\ASP.NET\MvcMusicStore2\MvcMusicStore2\Views\ShoppingCart\CartSummary.cshtml(3,7): error CS1503: Argument 1: cannot convert from 'void' to 'System.Web.WebPages.HelperResult'

Show Complete Compilation Source:


这里是the CartSummary.cshtml

@Html.ActionLink("Cart (" + ViewData["CartCount"] + ")", "Index", "ShoppingCart", new { id = "cart-status" })

    @Html.RenderAction("CartSummary", "ShoppingCart");

【问题讨论】:

  • CartSummary 操作是什么样的?
  • // GET: /ShoppingCart/CartSummary [ChildActionOnly] public ActionResult CartSummary() { var cart = ShoppingCart.GetCart(this.HttpContext); ViewData["CartCount"] = cart.GetCount(); return PartialView("CartSummary"); }
  • 好像没问题。我将代码添加到您的问题中以使其更具可读性。你有更多关于异常的细节吗?
  • 看起来从 CartSummary 操作返回的部分视图中有错误。
  • 你也可以发布 CartSummary.cshtml 吗?

标签: asp.net asp.net-mvc-3


【解决方案1】:

鉴于您的 CartSummary 局部视图,您似乎处于从局部视图调用局部视图的无限循环中。

     @Html.ActionLink("Cart (" + ViewData["CartCount"] + ")", "Index", "ShoppingCart", new { id = "cart-status" })

     //if this is in CartSummary, then it is calling itself over and 
     //over (or not at all, thus the error.)
     @Html.RenderAction("CartSummary", "ShoppingCart");

【讨论】:

  • 我对他的答案投了反对票,对你的答案投了反对票,因为你的答案排在第一位,他将自己的答案标记为解决方案。
【解决方案2】:

请检查您的部分视图是否有错误。 我今天遇到了类似的问题,我的问题是我重命名了模型的属性并且在视图中它没有改变。

可能这也是你的问题。试试看。

注意: 我将其发布在答案部分,因为我没有足够的声誉在您的问题下方发表评论。

【讨论】:

  • 局部视图中的错字。哦
【解决方案3】:

请从 CartSummary.cshtml 中删除 @model int 行。它对我有用。

【讨论】:

    【解决方案4】:

    我今天遇到了这个问题,结果我不小心有两个局部视图命名相同的东西,一个不断递归调用自己,更改另一个局部视图的名称允许流程再次流动。

    【讨论】:

      【解决方案5】:

      如果您收到这样的错误,则表示处理堆栈中的某处存在问题。按继续,完整的错误将输出到网页上。

      在我的情况下,我收到异常“System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper”,点击继续,然后网站上显示:

      Server Error in '/' Application.
      
      The partial view '_Chat' was not found or no view engine supports the searched locations. The following locations were searched:
      ~/Views/Home/_Chat.aspx
      ~/Views/Home/_Chat.ascx
      ~/Views/Shared/_Chat.aspx
      ~/Views/Shared/_Chat.ascx
      ~/Views/Home/_Chat.cshtml
      ~/Views/Home/_Chat.vbhtml
      ~/Views/Shared/_Chat.cshtml
      ~/Views/Shared/_Chat.vbhtml
      

      到了这一步就很容易找到了……

      【讨论】:

        【解决方案6】:

        如果我以特定用户身份登录,我的应用程序将返回相同的异常。

        我发现我的控制器上有一个 AuthorizeAttribute,它将操作结果更改为该用户的 RedirectToRoute 结果,导致 System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper 异常,因为从子操作重定向没有多大意义。

        我通过为返回 redirecttorouteresult 的子操作的属性 OnAuthorization 方法添加检查并为它们将结果重写为 EmptyResult 来解决此问题。

        【讨论】:

          【解决方案7】:

          在我的例子中,我只需要检查我试图访问的视图上的所有链接。

          确保所有控制器 Action 都有视图并再次运行您的应用程序,一切都会再次正常。

          【讨论】:

            【解决方案8】:

            我也时不时弹出相同的错误/异常。在我的情况下,这是由于我的一些控制器上有[RequireHttps],但不是全部。当某人(通常是机器人或蜘蛛)访问缺少该属性的控制器上的视图时,会导致此错误/异常。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 2011-03-06
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多