Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update to RC of WebApi causing Could not load type 'System.Web.Http.Dependencies.IDependencyResolver' from assembly error

I have recently upgraded to the RC versions of the WebApi using Nuget but am now getting the following error.

Could not load type 'System.Web.Http.Dependencies.IDependencyResolver' from assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Using the object browser, I can see the correct reference is in there. I have tried rebuilding, cleaning and clearing the temporary internet files.

A google search turned up http://forums.asp.net/t/1810546.aspx/1?Dependency+Resolver+throws+an+error+with+Unity but this wasn't much help.

Does anyone know what is causing this?

Screenshot from Visual Studio

like image 459
Tom Avatar asked Jun 11 '12 16:06

Tom


1 Answers

The answer in the end was that MVC 4 was conflicting, I assume that the dlls it put in the GAC were taking precedence, uninstalling MVC 4 fixed the problem for me.

like image 195
Tom Avatar answered Oct 22 '22 20:10

Tom