After deploying an MVC webpage to my IIS i get the following error:
Could not load file or assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I've done the following changes to prevent this issue:
- Set Copy Local = True for webhost
- Added WebApi 2.2 from nuget
- The System.Web.Http.WebHost exist i bin folder
- My web.config has the following dependentAssembly:
Code:
<dependentAssembly>
<assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
</dependentAssembly>
I still get the error, what am i doing wrong?