Failed to Execute URL

I am seeing some entries of the following exception in my logs and dont know why or where its occurring:

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)

Has anyone come across this before or could shed some light on it? I running a .net 3.5 c# web application on IIS7.


I just ran into this while using Windows Identity Foundation. The problem ended up being resolved by switching the application pool to use Integrated instead of Classic. It was failing when there was a trailing slash on the url and redirecting to the login page. Specifying the full page in the url didn't give the error.


I had the same error when using WIF in classic pipeline mode. Because we unfortunately cannot change the application to integrated pipeline mode, I've implemented a fix for the specific scenario that David Scott describes.

In 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();
      }
    }

Before the authentication attempt, Application_AuthenticateRequest is called with a null User object. Only in that case, the code redirects from / to /Default.aspx (my app is Asp.Net web forms). This fixed the problem for us.

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

上一篇: 覆盖Logback错误输出

下一篇: 无法执行网址