Configuration Error related to targetFramework in web.config

喜你入骨 提交于 2019-12-02 20:11:32

Your website project is targeting v4.6 of the .Net Framework but your hosting provider has not yet installed this version. Your options:

  1. Ask provider to install it - they are unlikely to do this.
  2. Find another provider that does support it.
  3. Change your project to target v4.5.

@DavidG has rightly pointed all the things. Just on informational side if IIS is your provider then Web Platform Installer is your best bet to check the current state of what all is installed on your machine currently. Have a look at the below snapshot -

It is really handy to check what all is missing and you can kick-start installation of all the missing pieces in one click.

I just had a similar problem following the installation ( windows update) of the KB 3205402.

Big difference with my case: the application worked well before the update !

==> I found in "IIS Manager", in "ISAPI and CGI Restrictions", that the framework ASP.NET v4.0.30319 has been switched to "unauthorized" !

Switching it to "Authorized" resolved my problem

I went round and round with this today with no resolution. Exasperated, I finally just deleted my working copy from my drive, and rechecked it out from SVN.

Fixed.

Not a particularly clever answer, but it fixed it for me, no idea what the actual problem was.

I changed:

<system.web>
    <compilation debug="true" targetFramework="4.7" />
    <httpRuntime targetFramework="4.7" />
    <customErrors mode="Off"/>
  </system.web>

to

<system.web>
     <compilation debug="true" targetFramework="4.5" />
     <httpRuntime targetFramework="4.5" />
     <customErrors mode="Off"/>
</system.web>

i.e, changed targetFramework value to 4.5 (the one supported on server) from 4.7. and worked.

had the same issue on the below line on an offline server ,

 <compilation targetFramework="4.5.2">

tried adding all the roles and features related to .Net framework from the server manager and to its pool ,

but didn't work , what worked for me is just downloading Microsoft .NET Framework 4.5.2(Offline Installer)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!