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