title: Autofac error: Could not load file or assembly 'System.Web.Http, Version=5.2.0.0,...' My project is Owin WebApi2 SelfHost
body: <p>I have a simple project which uses  Microsoft.AspNet.WebApi.OwinSelfHost.  It is a Owin self hosted WebApi 2 project.The project is pretty much similar to:-</p>
  
  <p><a href="https://github.com/attilah/AngularJSAuthentication" rel="noreferrer">https://github.com/attilah/AngularJSAuthentication</a></p>
  
  <p>The only difference I have is my Security module is in separate Assembly (everything similar to above project). I use Autofac to resolve my dependencies.</p>
  
  <p>This project worked when there's no Autofac. But once I am trying to setup my project with the corresponding security modules and Autofac all I am facing is this error:-</p>
  
  <pre><code>Could not load file or assembly 'System.Web.Http, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  </code></pre>
  
  <p>My configuration is very much inspired from this thread:-</p>
  
  <p><a href="https://stackoverflow.com/questions/25177734/dependency-injection-not-working-with-owin-self-hosted-web-api-2-and-autofac">Dependency injection not working with Owin self-hosted Web Api 2 and Autofac</a></p>
  
  <p>Moreover, I found someone else struggled with this dependency bug of Autofac and was able to get similar issue resolved by re-installing Microsoft.AspNet.WebApi.WebHost:</p>
  
  <p><a href="https://stackoverflow.com/questions/20226715/globalconfiguration-configure-not-present-after-web-api-2-and-net-4-5-1-migra">GlobalConfiguration.Configure() not present after Web API 2 and .NET 4.5.1 migration</a></p>
  
  <p>But this doesn't work for me I don't know why. I've tried re-installing everything from scratch also doesn't help. Besides the fact that Autofac has several permission issues while re-installing as well.</p>
  
  <p>Anybody has any experience with this error? please help. Thanks!</p>