12

I made a web site using VS 2012 and MVC4, it is work my localhost but when i published and put my host it doesn't work. IIS confiurations are same. But it gives me this error lines:

This is 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: The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, '<compilation targetFramework="4.0">'). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.

Source Error: 


Line 20:   </appSettings>
Line 21:   <system.web>
Line 22:     <compilation targetFramework="4.5" />
Line 23:     <httpRuntime targetFramework="4.5" />
Line 24:     <authentication mode="Forms">

Thank you for your advice in advance

3
  • 1
    I'm no expert on this particular subject, but is this really the entire error? Commented Aug 27, 2012 at 14:22
  • 14
    Is .NET 4.5 installed on your server? Commented Aug 27, 2012 at 14:45
  • I just installed and it certainly works, thanks for your advice. Commented Aug 27, 2012 at 15:35

7 Answers 7

12

Change this tag to 4.0:

<compilation targetFramework="4.0" />

and remove this tag:

<httpRuntime targetFramework="4.5" />
Sign up to request clarification or add additional context in comments.

1 Comment

Just had the same issue and realized that httpRuntime was the chunk that was blocking.
8

I had similar issue installing nopCommerce 2.80 on server. I use IIS7 net. 4.0 integrated pool. And just installed .net 4.5 from WebMatrix Products->Frameworks section. Restart will be required. Then it started to work.

Comments

5

You have to update your application pool to .net 4.0 in IIS. It's probably set to 2.0 currently.

Comments

2

Chances are IIS doesn't have 4 installed (or if it is the site isn't specified to use it). Assuming you're running IIS7 have a look at this post:

Comments

1

You just need to upgrade your .NET framework to ver 4.5 in your IIS 7.5 server you do that using the Microsoft web installer do a search for .NET and then installed the .NET framework version 4.5 and the all the apps that target that version will work

Comments

0

Run this: Microsoft .NET Framework Repair Tool

  • Make sure you run in offline mode if you need to run against servers that are firewalled off from the internet.

Comments

0

you have to install .net framework 4.5 then it will works fine. "targetframework" attribute is not recognized by .net framework 4.0. So run the following command on command prompt and check either .net version 4.5 in installed on hosting machine or not.if not then install .net framework 4.5.it will work fine. run this command on cmd as follows.

wmic /namespace:\\root\cimv2 path win32_product where "name like '%%.NET%%'" get version

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.