[Mono-dev] ASP.NET Web API on Mono 3.0 (Could not load type 'System.Web.Http.WebHost.HttpControllerHandler')

Rafael Teixeira monoman at gmail.com
Wed Oct 24 11:35:35 UTC 2012

Hi Daniel,

Well at
can see that such class is part of Mono and stable for at least 5 months,
so it surely should be found in Mono 3.0 but from your log it seems that
your server is loading a copy found on your bin directory, that may be

*Mono: Assembly Loader probing location:
Mono: Assembly Loader shadow-copied assembly to:
So please get rid of your copy of System.Net.Http.dll, and it should work.

In the other hand surely IHostBufferPolicySelector is missing from
Maybe this is newer than the open sourced files from Microsoft being used
in that part of Mono.

Please open an issue for this second problem, probably the aspnetstack
needs to be refreshed, although this may appear only in the 4.5 profile,
I'm not sure what are the .NET platform requirements for ASP.NET Web API.


Rafael "Monoman" Teixeira
"The most exciting phrase to hear in science, the one that heralds new
discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
Isaac Asimov
US science fiction novelist & scholar (1920 - 1992)

On Wed, Oct 24, 2012 at 2:03 AM, Daniel Lo Nigro <lists at dan.cx> wrote:
> Just rediscovered the MONO_LOG_LEVEL="debug" environment variable. Here's
the log from my app: http://sprunge.us/eXOV. I think these might be
related, but of course I could be totally wrong:
> Mono: The class System.Web.Http.Hosting.IHostBufferPolicySelector could
not be loaded, used in System.Web.Http, Version=, Culture=neutral,
> Mono: The class System.Net.Http.HttpMessageInvoker could not be loaded,
used in System.Net.Http, Version=, Culture=neutral,
> Thoughts?
> On Wed, Oct 24, 2012 at 2:23 PM, Daniel Lo Nigro <lists at dan.cx> wrote:
>> I'm trying to get ASP.NET WebApi working on Mono 3.0, and am getting
>> the following error:
>> System.TypeLoadException: Could not load type
>> 'System.Web.Http.WebHost.HttpControllerHandler' from assembly
>> 'System.Web.Http.WebHost, Version=, Culture=neutral,
>> PublicKeyToken=31bf3856ad364e35'.
>>   at (wrapper managed-to-native) System.Type:type_is_assignable_from
>> (System.Type,System.Type)
>>   at System.Type.IsAssignableFrom (System.Type c) [0x00096] in
>> /usr/local/src/mono-3.0.0/mcs/class/corlib/System/Type.cs:902
>>   at System.Web.Mvc.AreaRegistration.IsAreaRegistrationType
>> (System.Type type) [0x00000] in <filename unknown>:0
>>   at
>> (System.Type type) [0x00000] in <filename unknown>:0
>>   at
>> () [0x00059] in
>>   at System.Collections.Generic.List`1[System.Type].AddEnumerable
>> (IEnumerable`1 enumerable) [0x00013] in
>>   at System.Collections.Generic.List`1[System.Type]..ctor
>> (IEnumerable`1 collection) [0x0002f] in
>>   at System.Linq.Enumerable.ToList[Type] (IEnumerable`1 source)
>> [0x00006] in
>>   at System.Web.Mvc.TypeCacheUtil.GetFilteredTypesFromAssemblies
>> (System.String cacheName, System.Predicate`1 predicate, IBuildManager
>> buildManager) [0x00000] in <filename unknown>:0
>>   at System.Web.Mvc.AreaRegistration.RegisterAllAreas
>> (System.Web.Routing.RouteCollection routes, IBuildManager
>> buildManager, System.Object state) [0x00000] in <filename unknown>:0
>>   at System.Web.Mvc.AreaRegistration.RegisterAllAreas (System.Object
>> state) [0x00000] in <filename unknown>:0
>>   at System.Web.Mvc.AreaRegistration.RegisterAllAreas () [0x00000] in
>> <filename unknown>:0
>>   at Daniel15.WebApiTest.WebApiApplication.Application_Start ()
>> [0x00000] in <filename unknown>:0
>>   at (wrapper managed-to-native)
>> System.Reflection.MonoMethod:InternalInvoke
>> (System.Reflection.MonoMethod,object,object[],System.Exception&)
>>   at System.Reflection.MonoMethod.Invoke (System.Object obj,
>> BindingFlags invokeAttr, System.Reflection.Binder binder,
>> System.Object[] parameters, System.Globalization.CultureInfo culture)
>> [0x000d5] in
>> Followed by this error:
>> System.TypeLoadException:
>> A type load exception has occurred.
>> Description: HTTP 500.Error processing request.
>> Details: Non-web exception. Exception origin (name of application or
>> object): Daniel15.WebApiTest.
>> Are there additional debug flags I can use to determine what's causing
>> this and why it's unable to load the type? I'm using Mono 3.0
>> (compiled from source) and xsp/fastcgi-mono-server4 (latest Git
>> version)
>> Thanks in advance!
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20121024/cd1828bc/attachment.html>

More information about the Mono-devel-list mailing list