4

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?

ekad
  • 14,436
  • 26
  • 44
  • 46
Lord Vermillion
  • 5,264
  • 20
  • 69
  • 109
  • 1
    You can take a look at this thread : http://stackoverflow.com/questions/27369996/server-error-in-application-system-web-http-webhost – esylvestre Jan 29 '15 at 18:43

1 Answers1

0

You may need to check the web config in your "views" folder if you have one to make sure it has the proper binding redirect like you have in your main web config.

Austin_G
  • 177
  • 11