6

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.

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Could you explain a little about how to go about doing that? I can't figure out how to revert libraries to previous versions in Xamarin Studio.
It's been a while, I've moved on to other projects so please bear with me. If I remember correctly, I used NuGet. I uninstalled the latest version and searched for an earlier one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.