0

Inside my staging server I have .net version 4.5 installed and I developed my asp.net mvc web application.

Now when I deployed the application on production on production it raised an error on the web.config file :-

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.

So now I will do the following on production server:-

  1. I will download & install .net version 4.5 on production.
  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?

5
  • 1
    Yes, provided that when you deploy the application the app pool is set to use 4.5 and not 4.0 Commented Mar 5, 2014 at 13:27
  • so i do not want to modify my code,, so i will install the .nt verison 4.5 on production to keep my code as is ... Commented Mar 5, 2014 at 13:40
  • so will it work after installing 4.5 on production ? without the need to re-deploy an thing ? Commented Mar 5, 2014 at 13:41
  • Yes, you can install .NET Framework 4.5 you will restart your machine but you won't need to redeploy. Your code is already in production and the issue you reported is not based in your code. Once you finish the restart, go to your sites application pool and make sure that you change the target framework to 4.5 and that should solve your issue. Commented Mar 5, 2014 at 15:55
  • but i do no think i need to chnage the application pool to use 4.5 ... Commented Mar 6, 2014 at 1:27

1 Answer 1

3

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. 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. 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.

Sign up to request clarification or add additional context in comments.

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.