0

I have a web application developed in Framework 3.5. I changed to newer version of framework 4.0. If I run the same in local host it runs perfectly fine but as soon as I put it up in the web server it gives me the following error

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:

<compilation debug="true" targetFramework="4.0">

Kindly help me out. What change I would have to do in the code

user1923200
  • 59
  • 1
  • 4
  • 10

2 Answers2

0

Install .Net Framework 4.0 on IIS Server

sangram parmar
  • 8,462
  • 2
  • 23
  • 47
0

Solution 1:

This typically happens when you have an attribute of targetFramework="4.0" in the web.config but the App Pool is set to run ASP.NET 2.0.

The targetFramework attribute is entirely unrecognized by ASP.NET 2.0

  • so changing it to 2.0 won't have the desired effect.

Solution 2:

Right click on your website and follow

Start Options -> build tab - > Select Target Framework in combo box (.NET FrameWork 4)

Solution 3:

Still issue persist try this

You can do registering the framework with IIS is what worked for me:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i

Check out this too:

Hope this will solve your issue.

Community
  • 1
  • 1