my “hello world” ASP.NET application works fine in debug. However, after I publish, I have issues :
-
where do I control whether I want my website to serve Default.aspx or .asp as default page ? When I debug, it is calling Default.aspx with no problems, but after publish, it seems to request Default.asp
-
why do I get this error when I request Default.aspx manually ? (in browser)
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
A name was started with an invalid character. Error processing resource ‘http://localhost/slidenet/default.aspx’. Line 1, …<%@ Page Language=”C#” AutoEventWireup=”true” CodeBehind=”Default.aspx.cs” Inherits=”WebApplication1._Default” %>
-^ -
if I don’t request a page, it will call my Default.asp that I created on purpose, and again, same error :
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
Please try the following:
Click the Refresh button, or try again later.
Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 – Internal Server Error – ASP error
Internet Information Services
Technical Information (for support personnel)
Error Type:
Active Server Pages, ASP 0221 (0x80004005)
The specified ‘Page Language=”C#” AutoEventWireup=”true” CodeBehind=”Default.aspx.cs” Inherits=”WebApplication1.Default” ‘ option is unknown or invalid.
/slidenet/Default.asp, line 1
Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Page:
GET /slidenet/Default.asp
Time:
11 January 2012, 14:00:02
More information:
Microsoft Support
Could be that aspx engine hasn’t been registered correctly with IIS. The handlers for aspx are not present.
Try running aspnet_regiis -i (MSDN link) from the command line. It needs to be run from the directory of the version of the .Net framework you are installing i.e. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
I’ve seen this happen when IIS has been installed after the .Net framework so it doesn’t have a chance to register
The default page is a setting in IIS for the website as explained in the other answers.