I have made an MVC website in Visual Studio 2015 and it works in my localhost. But when I published my website and put into my host, it doesn\'t work. It gives me this error not
Your website project is targeting v4.6 of the .Net Framework but your hosting provider has not yet installed this version. Your options:
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)
@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 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.
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.