无法执行网址

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

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应用程序。


我在使用Windows Identity Foundation时遇到了这个问题。 通过切换应用程序池以使用Integrated而不是Classic来解决问题。 当网址上出现斜线并重定向到登录页面时,它失败了。 在url中指定完整页面并不会导致错误。


在传统流水线模式下使用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被一个空User对象调用。 只有在这种情况下,代码才会重定向到/Default.aspx(我的应用程序是Asp.Net Web表单)。 这为我们解决了这个问题。

链接地址: http://www.djcxy.com/p/6269.html

上一篇: Failed to Execute URL

下一篇: HTML5 LocalStorage not persistent on iOS after Power Off