Powered by Blogger.

Sunday, February 16, 2014

Configuration Error in asp.net

While working with Asp.Net I got this error while trying to deploy my web site in the server. The full error message is given below:

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

Parser Error Message: Unrecognized attribute 'requestValidationMode'. Note that attribute names are case-sensitive.

Source Error:
Line 43:         timeout="60"
Line 44:         />-->
Line 45:     <httpRuntime maxRequestLength="10240" requestValidationMode="2.0"/>

The main reason for this error is requestValidationMode is introduced in .Net 4.0. This problem will occur if your web server is setting to use .Net 2.0

Change the dot net framework version settings to use .Net 4.0. Then you will not get this error.

Another way to resolve this is to use ValidateRequest like below:

<%@ Page="" ValidateRequest="false" %>