This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 8549 - System.TypeLoadException: Could not load type 'MvcContrib.FluentHtml.Elements.TextBoxBase`1[T]' from assembly 'MvcContrib.FluentHtml, Version=3.0.100.0, Culture=neutral, PublicKeyToken=null'. (mono 3.0 + net4 profile)
: System.TypeLoadException: Could not load type 'MvcContrib.FluentHtml.Elements...
Status: RESOLVED FIXED
Product: Runtime
Classification: Mono
Component: JIT
: unspecified
: PC Windows
: --- normal
: ---
Assigned To: Bugzilla
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-11-21 19:01 EST by Pablo Ruiz García
Modified: 2012-11-30 17:49 EST (History)
4 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


Attachments
Test case demostrating the issue. (323.10 KB, application/octet-stream)
2012-11-21 19:01 EST, Pablo Ruiz García
Details

Description Pablo Ruiz García 2012-11-21 19:01:33 EST
Created attachment 2993 [details]
Test case demostrating the issue.

While upgrading an application from mono 2.10/net2.0 to mono 3.0.1/net4.0 I got
the following exception:

System.TypeLoadException: Could not load type
'MvcContrib.FluentHtml.Elements.TextBoxBase`1[T]' from assembly
'MvcContrib.FluentHtml, Version=3.0.100.0, Culture=neutral,
PublicKeyToken=null'.
  at (wrapper managed-to-native) System.Type:type_is_assignable_from
(System.Type,System.Type)
  at System.Type.IsAssignableFrom (System.Type c) [0x00000] in <filename
unknown>:0

Attached you will find a test case with requires dependencies which includes
the following code demostrating the issue:

using System;
using System.Collections.Generic;
using System.Web.Mvc;
using MvcContrib.FluentHtml.Elements;

namespace Test {
        public static class Program {
public static void Main()
{
        foreach (var type in
typeof(MvcContrib.FluentHtml.StringExtensions).Assembly.GetTypes())
                Console.WriteLine("{0} - {1}", type,
(typeof(AreaRegistration).IsAssignableFrom(type) &&
(type.GetConstructor(Type.EmptyTypes) != null)));
}
}
}

PS: I've tested it against master (a9c7937cb3f97744870bf6e1f865c71de2ad974b)
and fails too.
Comment 1 Pablo Ruiz García 2012-11-21 19:05:06 EST
Just in case it helps, here is somo logging obtained by running with
MONO_LOG_LEVEL=debug. 

This case under win32 with mono head a9c7937cb3f97744870bf6e1f865c71de2ad974b..

$ MONO_LOG_LEVEL=debug /opt/mono-trunk/bin/mono m2.exe
Mono: Assembly Loader probing location:
'C:\opt\mono-trunk\lib\mono\4.5\mscorlib.dll'.
Mono: Image addref mscorlib[006dc310] ->
C:\opt\mono-trunk\lib\mono\4.5\mscorlib.dll[01fe9b38]: 2
Mono: AOT failed to load AOT module
C:\opt\mono-trunk\lib\mono\4.5\mscorlib.dll.dll: The system cannot find the
file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\opt\mono-trunk\lib\mono\4.5\mscorlib.dll'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\mono\4.5\mscorlib.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\mscorlib\mscorlib.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\mscorlib\mscorlib.config'.
Mono: Assembly mscorlib[006dc310] added to domain m2.exe, ref_count=1
Mono: Config attempting to parse: 'C:\opt\mono-trunk\lib\..\etc\mono\config'.
Mono: Assembly Loader probing location: 'm2.exe'.
Mono: Image addref m2[02005d38] -> C:\temp\test2\m2.exe[01fe9578]: 3
Mono: Assembly m2[02005d38] added to domain m2.exe, ref_count=1
Mono: AOT failed to load AOT module C:\temp\test2\m2.exe.dll: The system cannot
find the file specified.


Mono: Assembly Loader loaded assembly from location: 'm2.exe'.
Mono: Config attempting to parse: 'C:\temp\test2\m2.exe.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\m2\m2.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\m2\m2.config'.
Mono: Assembly Loader probing location: 'm2.exe'.
Mono: AOT failed to load AOT module C:\temp\test2\m2.exe.dll: The system cannot
find the file specified.

Mono: Assembly Ref addref m2[02005d38] -> mscorlib[006dc310]: 2
Mono: Assembly Loader probing location:
'C:\temp\test2\MvcContrib.FluentHtml.dll'.
Mono: Image addref MvcContrib.FluentHtml[02028528] ->
C:\temp\test2\MvcContrib.FluentHtml.dll[0202fbb0]: 2
Mono: Assembly MvcContrib.FluentHtml[02028528] added to domain m2.exe,
ref_count=1
Mono: AOT failed to load AOT module
C:\temp\test2\MvcContrib.FluentHtml.dll.dll: The system cannot find the file
specified.


Mono: Assembly Loader loaded assembly from location:
'C:\temp\test2\MvcContrib.FluentHtml.dll'.
Mono: Config attempting to parse:
'C:\temp\test2\MvcContrib.FluentHtml.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\MvcContrib.FluentHtml\MvcContrib.FluentHtml.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\MvcContrib.FluentHtml\MvcContrib.FluentHtml.config'.
Mono: Assembly Ref addref m2[02005d38] -> MvcContrib.FluentHtml[02028528]: 2
Mono: Assembly Ref addref MvcContrib.FluentHtml[02028528] ->
mscorlib[006dc310]: 3
Mono: Config attempting to parse: 'C:\temp\test2\m2.exe.config'.
Mono: Assembly Loader probing location: 'C:\temp\test2\System.Web.Mvc.dll'.
Mono: Image addref System.Web.Mvc[020360a8] ->
C:\temp\test2\System.Web.Mvc.dll[020358d0]: 2
Mono: Assembly System.Web.Mvc[020360a8] added to domain m2.exe, ref_count=1
Mono: AOT failed to load AOT module C:\temp\test2\System.Web.Mvc.dll.dll: The
system cannot find the file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\temp\test2\System.Web.Mvc.dll'.
Mono: Config attempting to parse: 'C:\temp\test2\System.Web.Mvc.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\System.Web.Mvc\System.Web.Mvc.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\System.Web.Mvc\System.Web.Mvc.config'.
Mono: Assembly Ref addref m2[02005d38] -> System.Web.Mvc[020360a8]: 2
Mono: Assembly Ref addref System.Web.Mvc[020360a8] -> mscorlib[006dc310]: 4
Mono: Assembly Loader probing location:
'C:\opt\mono-trunk\lib\mono\gac\System.Web\4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'.
Mono: Image addref System.Web[0203aa68] ->
C:\opt\mono-trunk\lib\mono\gac\System.Web\4.0.0.0__b03f5f7f11d50a3a\System.Web.dll[0202c5a0]:
2
Mono: Assembly System.Web[0203aa68] added to domain m2.exe, ref_count=1
Mono: AOT failed to load AOT module
C:\opt\mono-trunk\lib\mono\gac\System.Web\4.0.0.0__b03f5f7f11d50a3a\System.Web.dll.dll:
The system cannot find the file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\opt\mono-trunk\lib\mono\gac\System.Web\4.0.0.0__b03f5f7f11d50a3a\System.Web.dll'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\mono\gac\System.Web\4.0.0.0__b03f5f7f11d50a3a\System.Web.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\System.Web\System.Web.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\System.Web\System.Web.config'.
Mono: Assembly Ref addref MvcContrib.FluentHtml[02028528] ->
System.Web[0203aa68]: 2
Mono: Assembly Ref addref MvcContrib.FluentHtml[02028528] ->
System.Web.Mvc[020360a8]: 3
Mono: Assembly Loader probing location:
'C:\temp\test2\System.Web.WebPages.dll'.
Mono: Image addref System.Web.WebPages[02028298] ->
C:\temp\test2\System.Web.WebPages.dll[02091ca8]: 2
Mono: Assembly System.Web.WebPages[02028298] added to domain m2.exe,
ref_count=1
Mono: AOT failed to load AOT module C:\temp\test2\System.Web.WebPages.dll.dll:
The system cannot find the file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\temp\test2\System.Web.WebPages.dll'.
Mono: Config attempting to parse:
'C:\temp\test2\System.Web.WebPages.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\System.Web.WebPages\System.Web.WebPages.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\System.Web.WebPages\System.Web.WebPages.config'.
Mono: Assembly Ref addref System.Web.Mvc[020360a8] ->
System.Web.WebPages[02028298]: 2
Mono: Assembly Ref addref System.Web.WebPages[02028298] -> mscorlib[006dc310]:
5
Mono: Assembly Ref addref System.Web.Mvc[020360a8] -> System.Web[0203aa68]: 3
Mono: Assembly Ref addref System.Web[0203aa68] -> mscorlib[006dc310]: 6
Mono: Assembly Loader probing location:
'C:\opt\mono-trunk\lib\mono\gac\System\4.0.0.0__b77a5c561934e089\System.dll'.
Mono: Image addref System[02094e98] ->
C:\opt\mono-trunk\lib\mono\gac\System\4.0.0.0__b77a5c561934e089\System.dll[02094518]:
2
Mono: Assembly System[02094e98] added to domain m2.exe, ref_count=1
Mono: AOT failed to load AOT module
C:\opt\mono-trunk\lib\mono\gac\System\4.0.0.0__b77a5c561934e089\System.dll.dll:
The system cannot find the file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\opt\mono-trunk\lib\mono\gac\System\4.0.0.0__b77a5c561934e089\System.dll'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\mono\gac\System\4.0.0.0__b77a5c561934e089\System.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\System\System.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\System\System.config'.
Mono: Assembly Ref addref System.Web[0203aa68] -> System[02094e98]: 2
Mono: Assembly Ref addref System[02094e98] -> mscorlib[006dc310]: 7
Mono: DllImport attempting to load: '__Internal'.
Mono: DllImport loaded library '(null)'.
Mono: DllImport searching in: '__Internal' ('(null)').
Mono: Searching for 'GetConsoleCP'.
Mono: Assembly Loader probing location:
'C:\opt\mono-trunk\lib\mono\gac\I18N\4.0.0.0__0738eb9f132ed756\I18N.dll'.
Mono: Image addref I18N[0209f3d0] ->
C:\opt\mono-trunk\lib\mono\gac\I18N\4.0.0.0__0738eb9f132ed756\I18N.dll[03292650]:
2
Mono: Assembly I18N[0209f3d0] added to domain m2.exe, ref_count=1
Mono: AOT failed to load AOT module
C:\opt\mono-trunk\lib\mono\gac\I18N\4.0.0.0__0738eb9f132ed756\I18N.dll.dll: The
system cannot find the file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\opt\mono-trunk\lib\mono\gac\I18N\4.0.0.0__0738eb9f132ed756\I18N.dll'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\mono\gac\I18N\4.0.0.0__0738eb9f132ed756\I18N.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\I18N\I18N.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\I18N\I18N.config'.
Mono: Assembly Ref addref I18N[0209f3d0] -> mscorlib[006dc310]: 8
Mono: Assembly Loader probing location:
'C:\opt\mono-trunk\lib\mono\gac\I18N.West\4.0.MvcContrib.FluentHtml.Behaviors.IBehaviorMarker
- False
MvcContrib.FluentHtml.Behaviors.IBehavior`1[T] - False
MvcContrib.FluentHtml.Behaviors.ThreadSafeBehavior - False
MvcContrib.FluentHtml.Behaviors.AutoLabelBehavior - False
MvcContrib.FluentHtml.Behaviors.AutoLabelSettings - False
MvcContrib.FluentHtml.Behaviors.CacheingBehaviorApplier - False
MvcContrib.FluentHtml.Behaviors.ThreadSafeDictionary`2[TKey,TValue] - False
MvcContrib.FluentHtml.Behaviors.CacheingBehaviorApplier+TypeToBehaviorMap -
False
MvcContrib.FluentHtml.Behaviors.BehaviorMarkerExtensions - False
MvcContrib.FluentHtml.Behaviors.BehaviorHelperExtensions - False
MvcContrib.FluentHtml.Behaviors.ThreadSafeMemberBehavior - False
MvcContrib.FluentHtml.Behaviors.RequiredCssClassBehavior - False
MvcContrib.FluentHtml.Behaviors.RequiredCssClassBehavior`1[TRequiredAttribute]
- False
MvcContrib.FluentHtml.Behaviors.GenericTypeSpec - False
MvcContrib.FluentHtml.Behaviors.IOrderedBehavior - False
MvcContrib.FluentHtml.Behaviors.IOrderedBehavior`1[T] - False
MvcContrib.FluentHtml.Behaviors.IBehavior - False
MvcContrib.FluentHtml.Behaviors.IBehaviorsContainer - False
MvcContrib.FluentHtml.Behaviors.IModelStateHandler - False
MvcContrib.FluentHtml.Behaviors.ISupportsMaxLength - False
MvcContrib.FluentHtml.Behaviors.ISupportsModelState - False
MvcContrib.FluentHtml.Behaviors.MemberBehaviorHelper`1[T] - False
MvcContrib.FluentHtml.Behaviors.ValidationBehavior - False
MvcContrib.FluentHtml.Behaviors.IMemberBehavior - False
MvcContrib.FluentHtml.Behaviors.TypeCssClassBehavior - False
MvcContrib.FluentHtml.Elements.IElement - False
MvcContrib.FluentHtml.Elements.IMemberElement - False
MvcContrib.FluentHtml.Elements.Element`1[T] - False
MvcContrib.FluentHtml.Elements.DisableableElement`1[T] - False
MvcContrib.FluentHtml.Elements.FormElement`1[T] - False
MvcContrib.FluentHtml.Elements.Input`1[T] - False
MvcContrib.FluentHtml.Elements.ButtonBase`1[T] - False
MvcContrib.FluentHtml.Elements.Button - False
MvcContrib.FluentHtml.Elements.CheckBoxBase`1[T] - False
MvcContrib.FluentHtml.Elements.CheckBox - False
MvcContrib.FluentHtml.Elements.OptionsElementBase`1[T] - False
MvcContrib.FluentHtml.Elements.CheckBoxListBase`1[T] - False
MvcContrib.FluentHtml.Elements.CheckBoxList - False
MvcContrib.FluentHtml.Elements.Choices - False
MvcContrib.FluentHtml.Elements.ColorPickerBase`1[T] - False
MvcContrib.FluentHtml.Elements.ColorPicker - False
MvcContrib.FluentHtml.Elements.DataListBase`1[T] - False
MvcContrib.FluentHtml.Elements.DataList - False
MvcContrib.FluentHtml.Elements.QuantityInputBase`1[T] - False
MvcContrib.FluentHtml.Elements.DateAndTimePickerBase`1[T] - False
MvcContrib.FluentHtml.Elements.DatePickerBase`1[T] - False
MvcContrib.FluentHtml.Elements.DatePicker - False
MvcContrib.FluentHtml.Elements.DateTimeLocalPickerBase`1[T] - False
MvcContrib.FluentHtml.Elements.DateTimeLocalPicker - False
MvcContrib.FluentHtml.Elements.DateTimePickerBase`1[T] - False
MvcContrib.FluentHtml.Elements.DateTimePicker - False
MvcContrib.FluentHtml.Elements.TextInput`1[T] - False
MvcContrib.FluentHtml.Elements.EmailBoxBase`1[T] - False
MvcContrib.FluentHtml.Elements.EmailBox - False
MvcContrib.FluentHtml.Elements.LabelBase`1[T] - False
MvcContrib.FluentHtml.Elements.Label - False
MvcContrib.FluentHtml.Elements.MonthPickerBase`1[T] - False
MvcContrib.FluentHtml.Elements.TimePickerBase`1[T] - False
MvcContrib.FluentHtml.Elements.UrlBoxBase`1[T] - False
MvcContrib.FluentHtml.Elements.MonthPicker - False
MvcContrib.FluentHtml.Elements.NumberBoxBase`1[T] - False
MvcContrib.FluentHtml.Elements.NumberBox - False
MvcContrib.FluentHtml.Elements.OptionChoices - False
MvcContrib.FluentHtml.Elements.RangeBoxBase`1[T] - False
MvcContrib.FluentHtml.Elements.RangeBox - False
MvcContrib.FluentHtml.Elements.ResetButtonBase`1[T] - False
MvcContrib.FluentHtml.Elements.ResetButton - False
MvcContrib.FluentHtml.Elements.Hidden - False
MvcContrib.FluentHtml.Elements.Index - False
MvcContrib.FluentHtml.Elements.FileUpload - False
MvcContrib.FluentHtml.Elements.FormLiteralBase`1[T] - False
MvcContrib.FluentHtml.Elements.FormLiteral - False
MvcContrib.FluentHtml.Elements.LiteralBase`1[T] - False
MvcContrib.FluentHtml.Elements.RadioButtonBase`1[T] - False
MvcContrib.FluentHtml.Elements.RadioButton - False
MvcContrib.FluentHtml.Elements.RadioSetBase`1[T] - False
MvcContrib.FluentHtml.Elements.RadioSet - False
MvcContrib.FluentHtml.Elements.SearchBoxBase`1[T] - False
MvcContrib.FluentHtml.Elements.SearchBox - False
MvcContrib.FluentHtml.Elements.TelephoneBoxBase`1[T] - False
MvcContrib.FluentHtml.Elements.TelephoneBox - False
0.0__0738eb9f132ed756\I18N.West.dll'.
Mono: Image addref I18N.West[032e5a88] ->
C:\opt\mono-trunk\lib\mono\gac\I18N.West\4.0.0.0__0738eb9f132ed756\I18N.West.dll[032ec610]:
2
Mono: Assembly I18N.West[032e5a88] added to domain m2.exe, ref_count=1
Mono: AOT failed to load AOT module
C:\opt\mono-trunk\lib\mono\gac\I18N.West\4.0.0.0__0738eb9f132ed756\I18N.West.dll.dll:
The system cannot find the file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\opt\mono-trunk\lib\mono\gac\I18N.West\4.0.0.0__0738eb9f132ed756\I18N.West.dll'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\mono\gac\I18N.West\4.0.0.0__0738eb9f132ed756\I18N.West.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\I18N.West\I18N.West.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\I18N.West\I18N.West.config'.
Mono: Assembly Ref addref I18N.West[032e5a88] -> I18N[0209f3d0]: 2
Mono: Assembly Ref addref I18N.West[032e5a88] -> mscorlib[006dc310]: 9
Mono: DllImport searching in: '__Internal' ('(null)').
Mono: Searching for 'GetConsoleOutputCP'.
Mono: Assembly Loader probing location:
'C:\opt\mono-trunk\lib\mono\gac\System.Core\4.0.0.0__b77a5c561934e089\System.Core.dll'.
Mono: Image addref System.Core[032e5af0] ->
C:\opt\mono-trunk\lib\mono\gac\System.Core\4.0.0.0__b77a5c561934e089\System.Core.dll[03313038]:
2
Mono: Assembly System.Core[032e5af0] added to domain m2.exe, ref_count=1
Mono: AOT failed to load AOT module
C:\opt\mono-trunk\lib\mono\gac\System.Core\4.0.0.0__b77a5c561934e089\System.Core.dll.dll:
The system cannot find the file specified.


Mono: Assembly Loader loaded assembly from location:
'C:\opt\mono-trunk\lib\mono\gac\System.Core\4.0.0.0__b77a5c561934e089\System.Core.dll'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\mono\gac\System.Core\4.0.0.0__b77a5c561934e089\System.Core.dll.config'.
Mono: Config attempting to parse:
'C:\opt\mono-trunk\lib\..\etc\mono\assemblies\System.Core\System.Core.config'.
Mono: Config attempting to parse:
'C:\Users\pruiz\.mono\assemblies\System.Core\System.Core.config'.
Mono: Assembly Ref addref MvcContrib.FluentHtml[02028528] ->
System.Core[032e5af0]: 2
Mono: Assembly Ref addref System.Core[032e5af0] -> mscorlib[006dc310]: 10
Mono: Assembly Ref addref MvcContrib.FluentHtml[02028528] ->
System.Web.WebPages[02028298]: 3

Unhandled Exception:
System.TypeLoadException: Could not load type
'MvcContrib.FluentHtml.Elements.TextBoxBase`1[T]' from assembly
'MvcContrib.FluentHtml, Version=3.0.100.0, Culture=neutral,
PublicKeyToken=null'.
  at (wrapper managed-to-native) System.Type:type_is_assignable_from
(System.Type,System.Type)
  at System.Type.IsAssignableFrom (System.Type c) [0x00000] in <filename
unknown>:0
  at Test.Program.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load
type 'MvcContrib.FluentHtml.Elements.TextBoxBase`1[T]' from assembly
'MvcContrib.FluentHtml, Version=3.0.100.0, Culture=neutral,
PublicKeyToken=null'.
  at (wrapper managed-to-native) System.Type:type_is_assignable_from
(System.Type,System.Type)
  at System.Type.IsAssignableFrom (System.Type c) [0x00000] in <filename
unknown>:0
  at Test.Program.Main () [0x00000] in <filename unknown>:0
Comment 2 Pablo Ruiz García 2012-11-21 23:13:18 EST
I've been debugging a bit around mono's runtime and finally found this to be
related to assembly verifying code.

I just tested peverify (from master) and it fails to validate
MvcContrib.FluentHtml.dll, however, this assembly comes from the official NuGet
Package whichs works just fine on MS.NET.

This is the peverify output:

$ /opt/mono-trunk/bin/peverify  --verify all MvcContrib.FluentHtml.dll
Error verifying class(0x0200001d) MvcContrib.FluentHtml.Elements.Element`1 a
type load error happened
Error verifying class(0x0200001d) MvcContrib.FluentHtml.Elements.Element`1 a
type load error happened
Error verifying class(0x0200001e)
MvcContrib.FluentHtml.Elements.DisableableElement`1 a type load error happened
Error verifying class(0x0200001e)
MvcContrib.FluentHtml.Elements.DisableableElement`1 a type load error happened
Error verifying class(0x0200001f) MvcContrib.FluentHtml.Elements.FormElement`1
a type load error happened
......
In method: MvcContrib.FluentHtml.Elements.TextBoxBase`1::.ctor(string)
Error: Could not load type MvcContrib.FluentHtml.Elements.TextBoxBase`1 at
0x0000
In method:
MvcContrib.FluentHtml.Elements.TextBoxBase`1::.ctor(string,MemberExpression,IEnumerable`1<IBehaviorMarker>)
Error: Could not load type MvcContrib.FluentHtml.Elements.TextBoxBase`1 at
0x0000
In method: MvcContrib.FluentHtml.Elements.TextBoxBase`1::List(string)
Error: Could not load type MvcContrib.FluentHtml.Elements.TextBoxBase`1 at
0x0000
In method: MvcContrib.FluentHtml.Elements.TextBox::.ctor(string)
Error: Could not load type MvcContrib.FluentHtml.Elements.TextBox at 0x0000
In method:
MvcContrib.FluentHtml.Elements.TextBox::.ctor(string,MemberExpression,IEnumerable`1<IBehaviorMarker>)
Error: Could not load type MvcContrib.FluentHtml.Elements.TextBox at 0x0000
In method:
MvcContrib.FluentHtml.ViewDataContainerExtensions::TextBox(IViewDataContainer,string)
Error: Could not load type MvcContrib.FluentHtml.Elements.TextBox at 0x0008
In method:
MvcContrib.FluentHtml.ViewModelContainerExtensions::TextBox(IViewModelContainer`1<T>,Expression`1<Func`2<T,
object>>)
Error: Could not load type MvcContrib.FluentHtml.Elements.TextBox at 0x0013
Error count: 7


From my debugging session I found that is_valid_generic_instantiation(gc,
context, gsint) fails to validate the assembly due to an internal call to
mono_class_is_assignable_from_slow(target, candidate) returning false..

This is as far as I got today, as all this runtime/verification internals are
new for me..
Comment 3 Pablo Ruiz García 2012-11-22 06:38:23 EST
As this seems to be a problem with mono verifier code, I'm adding Rodrigo just
in case he can help.
Comment 4 Rodrigo Kumpera 2012-11-22 13:20:03 EST
Fun bug! found a minimal repro:
----
class TextBoxBase<T> : TextInput<TextBox> where T : TextBoxBase<T> {}

class TextBox : TextBoxBase<TextBox> {}

class TextInput<T> : Input<T> where T: TextInput<T> {}

class Input<T> {}

class Driver {
    static void Main (){}
}
---

The fun part is that if you switch the declaration order of TextBoxBase with
TextBox it works!

Working on it.
Comment 5 Rodrigo Kumpera 2012-11-30 17:49:09 EST
Fixed on master, will be part of of 3.0.2.

Note You need to log in before you can comment on or make changes to this bug.