0

Problem:

I have an application defined within IIS, that points to a path containing a Web App. The Web App has a HttpHandler that handles all incoming requests, and forwards those requests onto other apps (also containing HttpHandlers) located in sub-directories, but not defined as applications in IIS. Essentially:

\
    \bin
        GatewayHandler.dll
        Application1.dll
    \Application1
        Application1Handler.ashx
    GatewayHandler.ashx
    web.config

The GatewayHandler, at the moment simply transfers the request to Application1 as follows:

public void ProcessRequest(HttpContext context)
{
    context.Server.Transfer("Application1/Application1.ashx", true);
}

Yet, running this I get the error:

Error executing child request for Application1/Application1Handler.ashx.

I've looked high and low but from all my searching I cannot find why this would not work. I require all requests to always pass through GatewayHandler.ashx, so I don't wish to use a browser redirect.

Edit: Just to be clear, I'm not transferring from a HttpHandler to an aspx page which works no problem; I'm wanting to transfer from a HttpHandler to another HttpHandler in a sub-directory.

R4D4
  • 1,382
  • 2
  • 13
  • 34
  • possible duplicate of [Server.Transfer throws Error executing child request. How to resolve?](http://stackoverflow.com/questions/2361690/server-transfer-throws-error-executing-child-request-how-to-resolve) – Patrick Hofman Jun 29 '14 at 19:12
  • @PatrickHofman Hi Patrick, thanks for pointing me in the direction of that QA, however I'm sorry but while it is close it isn't a duplicate. I'm not transferring from a HttpHandler to an aspx page, but a HttpHandler to another HttpHandler. – R4D4 Jun 29 '14 at 20:04
  • I think both are handled by the isapi asp.net handler. You can check by looking at the handlers' extensions in IIS. – Patrick Hofman Jun 29 '14 at 20:32
  • The thing is, as my edit says, transferring to an aspx page works no problem, however I'm wanting to transfer to a HttpHandler which ISN'T working, yet the 'duplicate' question deals with an issue which is a non-issue for myself. Thanks. – R4D4 Jun 29 '14 at 20:39
  • Are you sure the handler itself doesn't thrown an exception? – Patrick Hofman Jun 29 '14 at 20:41
  • It would appear not, the exception is thrown by the Transfer method. – R4D4 Jun 29 '14 at 21:29

0 Answers0