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.
Check to see if you have Microsoft Internet Information Server (IIS) installed.
See Microsoft IIS is Not Installed on Your Machine for details.
See Microsoft IIS is Stopped (Not Running) for details on starting (running) Microsoft IIS.
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.
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.
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.
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
Part VII: Troubleshooting Applications
Application Runs But No Data is Displayed