Note that there are some explanatory texts on larger screens.

plurals
  1. POFileLoadException after NuGet update for System.Web.Http
    text
    copied!<p>I just updated my installed projects from NuGet and got the unhandled exception below at runtime:</p> <blockquote> <p>Could not load file or assembly 'System.Web.Http, Version=4.0.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)</p> </blockquote> <p>The exception was thrown from NinjectWebCommon. The bootstraper.Initialize(CreateKernel); line of code was the offender.</p> <pre><code> public static void Start() { DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule)); bootstrapper.Initialize(CreateKernel); } </code></pre> <p>I assume that Ninject may have a dependency on the old version of System.Web.Http, but don't want to rollback if I don't have to.</p> <p>Has anyone had this problem and solved it?</p> <p><strong>EDIT</strong></p> <p>It seems as though the offending code is inside the bootstrapper.Initialize() method:</p> <pre><code>private static IKernel CreateKernel() { var kernel = new StandardKernel(); kernel.Bind&lt;Func&lt;IKernel&gt;&gt;().ToMethod(ctx =&gt; () =&gt; new Bootstrapper().Kernel); kernel.Bind&lt;IHttpModule&gt;().To&lt;HttpApplicationInitializationHttpModule&gt;(); RegisterServices(kernel); // Set Web API Resolver (using WebApiContrib.Ioc.Ninject) GlobalConfiguration.Configuration.DependencyResolver = new NinjectResolver(kernel); return kernel; } </code></pre> <p>When I commented out the line of code under the existing comment the project ran fine. Will need to figure out how to get WebApi to work without WebApiContrub.IoC.Ninject...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload