Just for others faced with this situation:
if you look in the web.config file, you will understand that in the <compilation> tag you have the targetFramework value set in version below 4.6. but in fact, during the build, you published your application through .NET FrameWork 4.6 or higher (corresponds to ASP.NET MVC 4.6 and higher).
So, if you change the targetFramework value to 4.6, the error will change the form to:
The 'targetFramework' attribute currently refers to a version that is later than the installed version of the .NET Framework.
this is a real mistake, and you will get rid of it by installing the appropriate version of the .NET Framework in the production environment of your web application.
AmiNadimi Aug 30 '16 at 15:21 2016-08-30 15:21
source share