Friday, April 25, 2008

Web.config for VS2005 is rejected by IIS as Badly Formed

I created a very simple website using VS .NET 2005. When I am trying to bring up my web page, I keep getting the following error message as shown below.


Server Error in '/APS_WebSetup' Application. ________________________________________
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'xhtmlConformance'

Source Error:

Line 89: -->
Line 90: <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
Line 91: <xhtmlConformance mode="Legacy"/>
Line 92: <pages>
Line 93: <namespaces>

Source File: C:\inetpub\wwwroot\APS_WebSetup\web.config Line: 91
________________________________________
Version Information: Microsoft .NET Framework Version: 1.1.4322.2407; ASP.NET Version: 1.1.4322.2407

************************************************************************************

Server Error in '/APS_WebSetup' Application. ________________________________________
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Child nodes are not allowed.

Source Error:

Line 91:
Line 92: <pages>
Line 93: <namespaces>
Line 94: <add namespace="Microsoft.VisualBasic"/>
Line 95: <add namespace="System.Data"/>

Source File: C:\inetpub\wwwroot\APS_WebSetup\web.config Line: 93
________________________________________
Version Information: Microsoft .NET Framework Version: 1.1.4322.2407; ASP.NET Version: 1.1.4322.2407

***********************************************************************************

These errors will occurred when I attempt to run an application developed using .NET framework 2.0 but Microsoft IIS web server defaults to an earlier version of the .NET framework, in my case is .NET 1.1.

To solve these errors, follow the steps as below:
1. Install .NET framework 2.0 (if it is not installed in your system).
2. Go to your IIS -> Default Web Site and select your virtual directory.
3. Right-click the virtual directory and click Properties.


4. Go to ASP .NET tab. Change the ASP .NET version to 2.0. Click Apply and OK.


Try to run the application again. The errors may solve now.

Hope this can help you all. Cheers!

1 comments:

Anonymous said...

Understandably your article helped me very much in my college assignment. Hats high to you send, will look progressive for the duration of more interdependent articles in a jiffy as its anecdote of my choice topic to read.

 

Get paid for your opinions! Click on the banner above to join Planet Pulse. Its totally free to sign up, and you can earn UNLIMITED. Find out more by visiting PLANET PULSE.
Sign up for PayPal and start accepting credit card payments instantly. http://www.emailcashpro.com
July Code Blog Copyright © 2010 Blogger Template Designed by Bie Blogger Template