4
votes

I am fresher developer in ASP.NET(4.0). I develop a website and it completely works in my local system. But now I upload all files to a server, and when I load any pages, an error occurs in the Web.config file.

My Web.Config Code is this:

  <?xml version="1.0" ?>
    <configuration>
        <connectionStrings>
        </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
        <customErrors mode="Off"/>
        <authentication mode="None"/>
    </system.web>
    </configuration>

The error is this (when I run at server):

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

Source Error:

</connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
    <customErrors mode="Off"/>
<authentication mode="None"/>

Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456

4
Yor web.config file is..?Soner Gönül
What kind of error you are getting?Dhaval Marthak
ERROR MESSAGE IN BROWSER.... 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: <compilation debug="true" targetFramework="4.0"/>Rajan Vachhani
it looks like the app pool is set to be a lower version (probably 2.0) than that which you are using. You need to go into IIS, find the AppPool and edit its basic settings to change the framework version from 2.0 (or whatever it currently is) to 4.0.Luke Baughan
How can i change this AppPool??Rajan Vachhani

4 Answers

4
votes

Just check the domain service settings, I am not clear about all the settings step but first of all you must set the target to 4.0 from the settings.

6
votes

In IIS, try setting your website's Application Pool's .NET Framework version to 4.0.

If your site is running on a hosting provider's server, and you don't have remote desktop access to it, they should have a way of setting the app pool's .net framework version somewhere within their website administration tool.

1
votes

You can also install the .NET framework 4.0 on the server.It is another solution for that problem.

0
votes

for me there was only ' front of <system.web> and it showed the same error!