Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type 'System.Web.Http.WebHost.HttpControllerHandler', in Mono / xsp4

I'm getting this error when trying to access Web API controller, accessing via 127.0.0.1/api/myController/1

Could not load type 'System.Web.Http.WebHost.HttpControllerHandler' from assembly 'System.Web.Http.WebHost, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System.Web.Http.WebHost.

Why is this happening? I see that it exists in System.Web.Http.WebHost.

like image 708
Jonas Arcangel Avatar asked Mar 06 '14 08:03

Jonas Arcangel


1 Answers

The error was due to the use of latest assemblies via NuGet. It turns out that, currently, Mono isn't completely compatible with WebAPI v5.1.

I replaced all my MVC libraries with a previous (v4.0) version and it all worked.

like image 134
Jonas Arcangel Avatar answered Oct 02 '22 00:10

Jonas Arcangel