Asp.net MCV4框架问题

ner*_*mik 11 c# asp.net asp.net-mvc-4

我使用VS 2012和MVC4创建了一个网站,它是我的本地主机,但是当我发布并放置我的主机它不起作用.IIS配置是一样的.但它给了我这个错误行:

这是错误;

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">
Run Code Online (Sandbox Code Playgroud)

提前感谢您的建议

小智 12

将此标记更改为4.0:

<compilation targetFramework="4.0" />
Run Code Online (Sandbox Code Playgroud)

并删除此标记:

<httpRuntime targetFramework="4.5" />
Run Code Online (Sandbox Code Playgroud)


iku*_*sin 8

我有类似的问题在服务器上安装nopCommerce 2.80.我使用IIS7网.4.0集成池.刚刚从WebMatrix Products-> Frameworks部分安装了.net 4.5.重启将是必需的.然后它开始工作.


rec*_*ive 5

您必须在IIS中将应用程序池更新为.net 4.0.它目前可能设置为2.0.