HTTP Error 500 - Page Cannot be Displayed

Problem

You get this error when first running your application:

HTTP Error 500 -- Page cannot be displayed...

This error occurs when your web server is not configured appropriately to run Microsoft .NET Framework applications.  There are several reasons your web server may not be configured properly.  Please review the following sections.

Microsoft IIS web server is not installed

Check to see if you have Microsoft Internet Information Server (IIS) installed. 

See Microsoft IIS is Not Installed on Your Machine for details.

Microsoft IIS is installed, but not running

See Microsoft IIS is Stopped (Not Running) for details on starting (running) Microsoft IIS.

Web Service Extensions are Disabled

If you are using Windows 2003, you must enable web service extensions.  See Running Microsoft IIS 6.0 on Windows Server 2003 for instructions on enabling web service extensions.

Microsoft IIS is not configured properly

Create a test.aspx file containing one line in your application folder (e.g., MyApp):

<% Response.Write("Testing") %>

Access this test page through your browser to see if the .NET Framework is correctly installed.  To run this from the browser, enter:

http://localhost/MyApp/test.aspx

If you see the word “Testing”, then everything is set up properly.  On the other hand, you might see the actual code from the file:

<% Response.Write("Testing") %>

In this case, your Microsoft IIS server is not configured to display ASPX pages properly.  If this is the case, check if the Microsoft .NET Framework is installed and then re-register ASP.NET.

See Verifying the .NET Framework was Installed after Microsoft IIS for instructions on how to re-register ASP.NET.

The ASPNET user is not configured properly

Check to make sure the ASPNET account has permissions to the folder containing your application.  Your ASPNET user needs full permissions in order for your application to run properly.

See ASP.NET User Does Not Have Permissions to Your Application Folder for instructions on granting access permissions.

Other causes

If your system is not patched properly, see: http://support.microsoft.com/default.aspx?kbid=831167

To see detailed messages when you get the HTTP 500 error message, see: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807

See Also

Part VII:  Troubleshooting Applications

Application Will Not Run

Application Runs But No Data is Displayed

Application Error Messages