I\'m trying to setup a test using NUnit to perform some integration testing of ASP.NET WebApi controllers. I\'ve found a couple articles discussing In-Memory hosting using Htt
I was seeing this problem also, seemed to go away when I moved my test class into the same assembly as my controller; generally not practical for testing I know.
After a bit of digging it appears there's a bug that only occurs with self host when the calling code doesn't share the same assembly as the controller as it hasn't managed to load the required assemblies.
To confirm this is your problem / temporarily workaround add this as the first line of your test: -
Type myType = typeof(myControllerType);
More info at : http://forums.asp.net/t/1772734.aspx/1