[Mono-dev] 2.0 profile version of Mono tools ?

Gert Driesen gert.driesen at telenet.be
Sat Mar 25 10:37:38 EST 2006


Hi,

Why is there no 2.0 profile version of all Mono tools (such as resgen, xsd,
...) ?

Right now, it's not possible to use any of these tools when you want to
build 2.0 applications.

If you have, for example, a resx file for which you need to reference a 2.0
assembly, then it's not possible to compile this resx file on Mono.

Any attempt to do this results in the following error:

** (resgen.exe:444): WARNING **: The class
System.Collections.Generic.IDictionary`2 could not be loaded, used in
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
Stacktrace:
in System.Resources.ResXResourceReader:.ctor (System.IO.Stream) <0xffffffff>
in System.Resources.ResXResourceReader:.ctor (System.IO.Stream) <0x30>
in (wrapper runtime-invoke) System.Object:runtime_invoke_void_Stream
(object,intptr,intptr,intptr) <0x50b31847>
in (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke
(object,object[]) <0x4>
in (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke
(object,object[]) <0xfffffc3d>
in System.Reflection.MonoCMethod:Invoke
(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],Sys
tem.Globalization.CultureInfo) <0x8d>
in System.Reflection.MonoCMethod:Invoke
(System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Glo
balization.CultureInfo) <0x1c>
in System.Activator:CreateInstance
(System.Type,System.Reflection.BindingFlags,System.Reflection.Binder,object[
],System.Globalization.CultureInfo,object[]) <0x245>
in System.Activator:CreateInstance (System.Type,object[],object[]) <0x24>
in System.Activator:CreateInstance (System.Type,object[]) <0x20>
in ResGen:GetReader (System.IO.Stream,string) <0xf9>
in ResGen:CompileResourceFile (string,string) <0x7b>
in ResGen:Main (string[]) <0x291>
in (wrapper runtime-invoke) System.Object:runtime_invoke_int_string[]
(object,intptr,intptr,intptr) <0x50b3fd87>
Native stacktrace:
    /home/monohead/mono/install/bin/mono(mono_handle_native_sigsegv+0xc3)
[0x814ba83]
    /home/monohead/mono/install/bin/mono [0x8137686]
    /lib/libpthread.so.0 [0xb7ed56d7]
    [0xffffe440]
    /home/monohead/mono/install/bin/mono [0x8091a2e]
    /home/monohead/mono/install/bin/mono [0x8091d9a]
    /home/monohead/mono/install/bin/mono(mono_metadata_parse_type_full+0xf6)
[0x8090f26]
 
/home/monohead/mono/install/bin/mono(mono_metadata_parse_method_signature_fu
ll+0x108) [0x8091358]
    /home/monohead/mono/install/bin/mono(mono_method_signature+0xff)
[0x80ce33f]
    /home/monohead/mono/install/bin/mono [0x80cf7e8]
    /home/monohead/mono/install/bin/mono [0x811bed5]
    /home/monohead/mono/install/bin/mono [0x81267cd]
    /home/monohead/mono/install/bin/mono [0x8136175]
    /home/monohead/mono/install/bin/mono [0x8136cfd]
    /home/monohead/mono/install/bin/mono [0x813715e]
    /home/monohead/mono/install/bin/mono [0x813727a]
    /home/monohead/mono/install/bin/mono(mono_compile_method+0x18)
[0x80ced48]
    /home/monohead/mono/install/bin/mono(mono_magic_trampoline+0x1a)
[0x814ce5a]
    [0xb7d40032]
    [0xb7605d16]
    /home/monohead/mono/install/bin/mono [0x8137530]
    /home/monohead/mono/install/bin/mono(mono_runtime_invoke+0x27)
[0x80d0477]
    /home/monohead/mono/install/bin/mono(mono_runtime_invoke_array+0x188)
[0x80d16f8]
    /home/monohead/mono/install/bin/mono [0x80d85f4]
    [0xb7605c5c]
    [0xb760586e]
    [0xb76057d5]
    [0xb760429e]
    [0xb7603f2d]
    [0xb7603ea9]
    [0xb7603222]
    [0xb75ffbec]
    [0xb75f7afa]
    [0xb75f77d4]
    /home/monohead/mono/install/bin/mono [0x8137530]
    /home/monohead/mono/install/bin/mono(mono_runtime_invoke+0x27)
[0x80d0477]
    /home/monohead/mono/install/bin/mono(mono_runtime_exec_main+0xaf)
[0x80d148f]
    /home/monohead/mono/install/bin/mono(mono_runtime_run_main+0x19f)
[0x80d10cf]
    /home/monohead/mono/install/bin/mono [0x805c591]
    /home/monohead/mono/install/bin/mono(mono_main+0x817) [0x805cf67]
    /home/monohead/mono/install/bin/mono [0x805b90b]
    /lib/libc.so.6(__libc_start_main+0xad) [0xb7d9851d]
    /home/monohead/mono/install/bin/mono [0x805b841]

This is because resgen is a 1.1 (1.0 profile) assembly (which loads some 1.1
system assemblies) and hence you end with a 1.0 runtime, which ofcourse
can't deal with 2.0 assemblies.

Why not just build all Mono tools in both 1.0 and 2.0 profile ? Even if the
source code is exactly the same, you still need these profile-specific
assemblies.

We would then have, for example, a resgen.exe in $prefix/lib/mono/1.0 and
$prefix/lib/mono/2.0. You can then even have a small wrapper script (named
resgen) that executes one of these assemblies based on some environment
variable (MONO_PROFILE) or something.

Isn't this better than having wsdl, wsdl2, wsdl3, ... ?

Any feedback is appreciated ...

Gert





More information about the Mono-devel-list mailing list