Friday, October 3, 2008

The XML page cannot be displayed

This is a very common error people face when installing ASP.Net applications.

You finish installing the app and go to the corresponding URL in the browser and you see this error message "The XML page cannot be displayed. Cannot view XML input using XSL style sheet. Please correct the error and then click Refresh button, or try again later. A name was started with an invalid character. Error processing resource 'http://servername/applicationname/'."

This is caused due to the fact that the .aspx and .asmx extensions are not registered in your IIS website properly. Perform the following steps to remedy the solution:

1) Open IIS (Start->Run->inetmgr)
2) Right click your website (virtual directory) and select properties.
3) Click the configuration button.
4) In the Application Configuration screen, click add and browse to the path 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' and in the Extension box type '.aspx' and click ok. Perform this step again for the .asmx extension pointing to the same executable file.
5) Click OK and close the properties box.

Now test your website and it should work fine. Please note that the above steps are for IIS 5.1, but the steps in IIS 6.0 mimic these closely.

Hope this helps!

No comments: