【问题标题】:Failed to Execute URL - any ideas?无法执行 URL - 有什么想法吗?
【发布时间】:2018-12-17 11:35:40
【问题描述】:

我在我的日志中看到以下异常的一些条目,但不知道它发生的原因或位置:

Failed to Execute URL.
   at System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.BeginExecuteUrl(String url, String method, String childHeaders, Boolean sendHeaders, Boolean addUserIndo, IntPtr token, String name, String authType, Byte[] entity, AsyncCallback cb, Object state)
   at System.Web.HttpResponse.BeginExecuteUrlForEntireResponse(String pathOverride, NameValueCollection requestHeaders, AsyncCallback cb, Object state)
   at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

以前有没有人遇到过这种情况或者可以对此有所了解?我在 IIS7 上运行 .net 3.5 c# Web 应用程序。

【问题讨论】:

标签: c# asp.net exception


【解决方案1】:

我在使用 Windows Identity Foundation 时遇到了这个问题。该问题最终通过将应用程序池切换为使用集成而不是经典来解决。当 url 上有一个斜杠并重定向到登录页面时,它失败了。在 url 中指定完整页面并没有给出错误。

【讨论】:

    【解决方案2】:

    在经典管道模式下使用 WIF 时,我遇到了同样的错误。因为很遗憾我们无法将应用程序更改为集成管道模式,所以我针对 David Scott 描述的特定场景实施了修复。

    在 global.asax.cs 中:

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {        
          // Fix for "Failed to Execute URL" when non-authenticated user 
          // browses to application root 
          if ((User == null) 
            && (string.Compare(Request.Url.AbsolutePath.TrimEnd('/'), 
            Request.ApplicationPath, true) == 0))
          {
            Response.Redirect(Request.ApplicationPath + "/Default.aspx");
            HttpContext.Current.ApplicationInstance.CompleteRequest();
          }
        }
    

    在身份验证尝试之前,Application_AuthenticateRequest 使用 null User 对象调用。只有在这种情况下,代码才会从 / 重定向到 /Default.aspx(我的应用程序是 Asp.Net 网络表单)。这为我们解决了问题。

    【讨论】:

      【解决方案3】:

      当我在经典模式下将 WIF 与 .NET 4.5 应用程序一起使用时,我也遇到了这个问题。用户从 ADFS 获得身份验证,然后用户收到此错误。以前我发送 E-Mail-Addresses -> E-Mail-Address 作为声明。添加另一个声明规则为 E-Mail-Addresses -> Name 为我解决了这个问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-20
        • 2016-08-05
        • 2017-07-19
        • 1970-01-01
        相关资源
        最近更新 更多