Why are blank pages being served with "200 OK" for asp.net errors in IIS 8.5 (Win 2012 R2)?

15,813

Solution 1

Had a similar issue on Windows 8.

In settings search for "Turn Windows features on or off".

Check that the following features are enabled

"/Internet Information Services/World Wide Web Services/Common HTTP Features/HTTP Errors". "/Internet Information Services/World Wide Web Services/Common HTTP Features/Static Content".

Solution 2

You need to ensure Server Side Debugging is not enabled in the ASP module.

Classic ASP server 500 errors are returned as 200's. An attempt is made at opening the Server Side Debug Application, that then can't be found and IIS subsequently returns a 200 response and a blank page.

Solution 3

Make sure that you are not calling Server.ClearError() in Application_Error of Global.asax.cs that ended up being my problem.

Solution 4

Ripping out all Global.asax code helped me to find the cause of the error.

After that, the IIS started to return the error page as expected. Then, after the fix is applied, I returned the Global.asax code back.

Maybe this case helps you.

Solution 5

I had a similar issue when requesting the Default.aspx (set as page default in directory). The Server returned status 200, but the Content was blank.

In this case it worked to switch the Application pool's managed pipeline mode from integrated to classic.

Share:
15,813
NickG
Author by

NickG

ASP.NET Website Developer for a small software company in Winchester, Hampshire (UK).

Updated on June 15, 2022

Comments

  • NickG
    NickG almost 2 years

    I've set up a new Windows 2012 R2 server running IIS 8.5.

    We noticed that when an error occurs (eg the ASP.NET State Service was not running) that instead of outputting a 500 status code error screen, the request actually returns a totally blank page (only headers - with no content). We obviously need to see the errors and serving 200 OK for an error could be very problematic for indexers like Google etc or any wesite monitoring tools (which would not notify us that the site had gone offline).

    On our other servers (IIS 7) we see the "yellow error screen" with a message like "could not connect to state server" (or similar).

    What could possibly be wrong here? Is there some setting to globablly disable all errors (but this would be stupid if it also serves the 200 status code) or could something else be getting in the way?

    The only other thing which could be interfering is we've got ISAPI_Rewrite installed on the server (but this doesn't usually cause this problem).

    Thanks!

  • Adam
    Adam about 9 years
    For developing local .net website also check "/Internet Information Services/World Wide Web Services/Application Development Features/ASP.Net 3.5" and "/Internet Information Services/World Wide Web Services/Application Development Features/ASP.Net 4.5"
  • DeadlyChambers
    DeadlyChambers almost 9 years
    This is a good approach for finding the error in your custom error handling. If you have implemented this.
  • Diego Jancic
    Diego Jancic over 8 years
    Same happened to me on Win10 after upgrading from 8.1. Thank you :)
  • Younis Qadir
    Younis Qadir over 7 years
    does antivirus affect this issue ? because i've installed all mentioned feature but still getting this error 500-19
  • Rich S
    Rich S about 7 years
    Perfect.. this allowed me to track down the actual error
  • NickG
    NickG about 5 years
    This was 6 years ago... Pretty sure I ended up fixing it :)
  • TetraDev
    TetraDev about 4 years
    Thank you! That solved it! I have no idea why this was even added to our project in the first place. Hiding an error in development mode is terrible!