简体   繁体   English

无法在asp.net 4.0版上部署我的asp.net MVC Web应用程序

[英]Was not able to deploy my asp.net MVC web application on asp.net version 4.0

Inside my staging server I have .net version 4.5 installed and I developed my asp.net mvc web application. 在我的登台服务器中,我安装了.net 4.5版,并开发了asp.net mvc Web应用程序。

Now when I deployed the application on production on production it raised an error on the web.config file :- 现在,当我将应用程序部署到生产环境中时,它在web.config文件上引发了错误:

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 63:     </caching>
Line 64:     <customErrors mode="RemoteOnly" />
Line 65:     <compilation targetFramework="4.5">
Line 66:       <assemblies>
Line 67:         <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 

Source File: C:\inetpub\wwwroot\web.config (file:///C:/inetpub/wwwroot/web.config)    Line: 65 



  _____  


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 So 

I checked the .net version on production and it was 4.0 instead of 4.5. 我在生产中检查了.net版本,它是4.0而不是4.5。

So now I will do the following on production server:- 所以现在我将在生产服务器上执行以下操作:

  1. I will download & install .net version 4.5 on production. 我将在生产环境中下载并安装.net 4.5版。
  2. Restart the production server over-night. 整夜重新启动生产服务器。

So will this solve the problem, or I have do re-deploy my whole asp.net mvc on IIS for it to take the new .net version? 那么这将解决问题,还是我已经在IIS上重新部署了整个asp.net mvc,以使其采用新的.net版本?

You have already deployed your site to the server (otherwise you wouldn't be seeing that error) so yes, all you will need to do is install .Net 4.5 on the server. 您已经将站点部署到服务器上(否则您将不会看到该错误),因此,您需要做的就是在服务器上安装.Net 4.5。 You may not even need to reboot it although it would be the safest option. 尽管这是最安全的选择,但您甚至不需要重新启动它。

You will not need to check the application pool as .Net 4.5 is not a new version of .Net, it still runs off the .Net 4.0 runtime and you will not see a .Net 4.5 option in the application pool settings. 您将不需要检查应用程序池,因为.Net 4.5不是.Net的新版本,它仍然在.Net 4.0运行时中运行,并且您在应用程序池设置中不会看到.Net 4.5选项。 Much the same as you don't see a .Net 3.0 or 3.5 setting for an application pool because they were both extensions to the .Net 2.0 runtime. 与您没有看到应用程序池的.Net 3.0或3.5设置一样,因为它们都是.Net 2.0运行时的扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM