Thursday, 15 April 2010

c# - TypeLoadException from Mono -



c# - TypeLoadException from Mono -

i'm trying mono 3.4.0 working of microsoft owin components. i've started testing on windows, when application handles http request, next exception:

system.typeloadexception: not load type 'microsoft.owin.security.authenticateresult' assembly 'microsoft.owin, version=2.1.0.0, culture=neutral, publickeytoken=31bf3856ad364e35'.

the application beingness compiled using visual studio standard .net assembly expectation should run on mono runtime.

i added microsoft.owin nuget bundle console application , managed reproduce problem next code:

class programme { static void main(string[] args) { var instance = new authenticateresult( null, new authenticationproperties(), new authenticationdescription()); console.writeline(instance.gettype().assemblyqualifiedname); } }

running in .net, application starts , prints out type information. if it's run through mono, application prints out exception , fails.

further, code works in both .net , mono:

class programme { static void main(string[] args) { var type = typeof(authenticateresult); console.writeline(type.assemblyqualifiedname); } }

i've tested number of types microsoft.owin assembly, similar results. if load type using typeof operator before it's needed, mono doesn't raise exception, instead throwing exception trying load different type (presumably next 1 code needed).

why getting unusual behaviour when running in mono? there have specify on command-line load assemblies expect .net clr? there can farther info why type failed loaded?

it looks type load error caused 1 of types used types reference in code, not types use.

if run set mono_log_level=debug before running program, see next in output:

mono: class system.security.claims.claimsidentity not loaded, used in mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089

checking against mono status page can see none of system.security.claims namespace has been implemented in mono yet.

c# mono katana

No comments:

Post a Comment