How To Resolve HttpException (0x80004005): Failed to Execute URL
Summary: Ambuj Nautiyal, a Microsoft Premier Field Engineer based in Canada, walks us through a solution for the circumstance where your .NET application(s) throw the error HttpException: Failed to Execute URL.
I was recently working with one of my customers and when they deployed a .NET application into production one of the settings on IIS was preventing the application from operating. The customer’s operations team had spent considerable time trying to resolve the exception, which was particularly baffling as the same application was working absolutely fine in the test environment. The exception we were running into is Failed to Execute URL. Somehow this exception does not emit any IIS error information on the server. Typically, but not always, you would see this exception in conjunction with an environment residing behind ADFS.
More specifically, the exception appeared as follows:
Failed to Execute URL.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Failed to Execute URL.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
And here’s the associated stack trace:
[HttpException (0x80004005): Failed to Execute URL.]
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) +4040320
System.Web.HttpResponse.BeginExecuteUrlForEntireResponse(String pathOverride, NameValueCollection requestHeaders, AsyncCallback cb, Object state) +590
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +286
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +405
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375
Looking at the exception details -- System.Web.HttpException: Failed to Execute URL -- it indicates that URL authorization that is failing. You can check out details of URL authorization in this article on ASP.NET Authorization.
Resolving this problem requires you to make sure you deny Anonymous Users in your .NET authorization rules for the application, as follows:
As mentioned in the article on ASP.NET Authorization, this can be controlled by the developer of the application, and by using the <authorization> element in web.config file, as follows:
<system.web>
<authorization>
<deny users="?" />
….
….
</authorization>
</system.web>
Hope this will be of help to you and saves you some troubleshooting time.
Article written by Ambuj Nautiyal ; Posted by Frank Battiston , MSPFE Editor
Comments
Anonymous
August 28, 2013
The comment has been removedAnonymous
November 06, 2013
This does not help me. I get this error every time I want to extract a file. I have to use my laptop for a simple extract. I am assuming the corruption happens during download. Why? Because I cannot extract the file on my laptop until I get a new download to extract. I have tried search results for several months and the solution is never downloading third party unknown cleaners. I suffer from this inconvenience even after Windows 8.1 upgrade.Anonymous
November 07, 2013
It's one of the most generic failure codes out there, and might happen for any reason. Any program can create the error. If you can work out the program you're using that creates the error, and particularly the function causing the error, you can usually work out why it's happening, either with Procmon or a debugger. If you can't, then you could call someone like MS support for help, or post enough details to a forum that someone might be able to assist.Anonymous
June 30, 2014
I fixed the similar issue with changing application pool 64 bit to 32 bit. "Enable 32 bit application"Anonymous
January 22, 2015
aaa