C# 在安装了4.0.3的服务器上部署MVC 4.5.1时出现Targetframework错误

C# 在安装了4.0.3的服务器上部署MVC 4.5.1时出现Targetframework错误,c#,asp.net-mvc,iis-7,C#,Asp.net Mvc,Iis 7,我的windows server 2008 R2当前已安装.NET framework v4.0.3x 我有一个ASP.NET MVC 4.5.1应用程序,在部署时会出现以下错误: 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 (f

我的windows server 2008 R2当前已安装.NET framework v4.0.3x

我有一个ASP.NET MVC 4.5.1应用程序,在部署时会出现以下错误:

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 37:   </appSettings>
Line 38:   <system.web>
Line 39:     <compilation debug="true" targetFramework="4.5.1" />
Line 40:     <httpRuntime targetFramework="4.5.1" />
Line 41:     <pages> 
Web.config文件元素中的“targetFramework”属性仅用于针对.NET Framework的4.0及更高版本(例如“”)。“targetFramework”属性当前引用的版本高于.NET Framework的已安装版本。指定有效的.NET Framework目标版本,或安装所需的.NET Framework版本。
源错误:
第37行:
第38行:
第39行:
第40行:
第41行:
我是否需要在服务器上安装一些东西,还是因为我没有在my/bin文件夹中部署正确的dll


我已经安装了IIS 7.5.7x。

您需要在服务器上安装当前的.Net Framework。在此之后,它应该可以工作,因为IIS在4.0和4.5之间没有区别。此外,您需要在IIS管理中选择正确的目标框架


是如何完成的。

嗨,我需要安装的链接在哪里?我已经将我的应用程序池设置为使用4.x。我相信这已经解决了,所以您要么接受下面的答案,要么发布/接受您自己的答案。