Resolution: Set the correct version of the ASP.NET framework for the application in IIS
If you have just setup your website for example by creating and mapping virtual directory with your website folder, chances are that you face this error. Open IIS managr and check the ASP.net version of the concerned virtual directory. If it is version 1.1, make it version 2.0 and save the changes. The error will be resolved.