Server.TransferRequest returns blank page on specific server

Posted by jishi on Stack Overflow See other posts from Stack Overflow or by jishi
Published on 2010-06-17T09:30:30Z Indexed on 2010/06/17 9:33 UTC
Read the original article Hit count: 260

I'm facing an issue that seems to be related to configuration.

I have a webapplication based on MonoRail, where we utilize the routing feature from MonoRail. On the first request after the application has started, the routing isn't initialized. To circumvent this, I have the following code in Application_OnError():

public virtual void Application_OnError()
{
    if ( // identified as routing error )
    Server.TransferRequest( Context.Request.RawUrl, false );
    return;
}

Problem beeing that on our development server (which runs server 2008 R2, with IIS 7.5 and .NET 3.5) returns a blank page without headers, but on my workstation (which runs win7, IIS 7.5 and .NET 3.5) it works fine.

What could be the cause of this? If the code in Application_OnError() throws an exception, what would be the expected output?

I have verified the following:

  • The access-log shows one entry, I'm not sure if a TransferRequest would show up as a second entry when invoked successfully
  • The application actually do some work according to my internal logs, and it doesn't die since a subsequent requests works flawlessly (because routing will be active)

Any hints on what to look for would be greatly appreciated!

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about error-handling