Reputation: 1437
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
Reputation: 17194
It is because of the below cases:
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
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