TheChampp
TheChampp

Reputation: 1437

Server Exception With ASPX

When I run aspx code through web server I get the following exception. What should I do to fix it ?

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 attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error:

Line 9: <system.web>

Line 10:<customErrors mode="Off"/>

Line 11: <compilation debug="true" targetFramework="4.5" />

Line 12:<httpRuntime targetFramework="4.5" />

Line 13: </system.web>

Upvotes: 2

Views: 4597

Answers (2)

Vishal Suthar
Vishal Suthar

Reputation: 17194

It is because of the below cases:

  1. Your Application pool may configured for the .net framework version 2.0.
  2. Or the framework 4.5 may not be installed on your server.

Make sure the framework is registered with the IIS.

Go to "Website" in IIS -> Start Options -> build tab – > Select Target Framework in combo box (.NET FrameWork 4.5)

Upvotes: 3

Darin Dimitrov
Darin Dimitrov

Reputation: 1039588

There's no targetFramework attribute for the <httpRuntime> node. You should remove it from your web.config:

<system.web>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime />
</system.web>

Also make sure that you have configured the IIS application pool to use the correct version of the .NET framework.

Upvotes: 1

Related Questions