[Mono-dev] CS0006: Cannot find assembly `mgnat.dll'
Robert Jordan
robertj at gmx.net
Sun Nov 13 05:53:49 EST 2005
Hi Laurent,
Your assembly is not a valid PE file. You may check it yourself
with pedump --verify all mgnat.dll
Robert
> Hi Rafael, I set the two variables (with export x=y)
> but mcs didn't output any more information. I tried
> /warning:4 but nothing too.
>
> strace mcs log part:
>
> ...
> open("/home/guerby/tmp/mgnat/src/lib/mgnat.dll", O_RDONLY|O_LARGEFILE) = 7
> fstat64(7, {st_mode=S_IFREG|0644, st_size=973824, ...}) = 0
> mmap2(NULL, 974848, PROT_READ, MAP_PRIVATE, 7, 0) = 0x40eb0000
> mprotect(0x40eb0000, 974848, PROT_READ|PROT_EXEC) = 0
> close(7) = 0
> munmap(0x40eb0000, 973824) = 0
> mmap2(NULL, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40eb0000
> write(2, "error CS0006: Cannot find assemb"..., 46error CS0006: Cannot find assembly `mgnat.dll') = 46
> ...
>
> Laurent
>
> PS: are you able to reproduce the problem? This should do it:
>
> $ cd /some/where
> $ wget http://guerby.org/ftp/mgnat.dll
> $ cat > ada.cs << EOF
> namespace ada {
> }
> EOF
> $ mcs /debug /r:mgnat.dll /t:library /out:mgnatcs.dll ada.cs
>
> On Sat, 2005-11-12 at 22:14 -0200, Rafael Teixeira wrote:
>
>>Normally such errors occur when the assembly p/invokes into native
>>code and the needed native library can't be found.
>>
>>Set MONO_LOG_LEVEL="debug" and MONO_LOG_MASK="dll" and run again to
>>have more detailed information about the way mono is trying to load
>>your dll.
>>
>>:)
>>
>>On 11/12/05, Laurent GUERBY <laurent at guerby.net> wrote:
>>
>>>Hi, I'm trying to get the Ada to C# compiler[1] to work under
>>>SuSE Linux 9.3 with mono 1.1.10-2.novell.
>>>
>>>Using ilasm and *.il files generated by the A# compiler I'm able
>>>to create the mgnat.dll assembly:
>>>
>>>$ cat *.il > ada_lib.msil
>>>$ ilasm /debug /dll /key=$(DLL_DIR)/TestKey.snk /output=mgnat.dll ada_lib.msil
>>>$ ls -l mgnat.dll
>>>-rw-r--r-- 1 guerby users 973824 2005-11-12 20:29 mgnat.dll
>>>
>>>But then I cannot use it (same directory):
>>>
>>>$ mcs /debug /r:mgnat.dll /t:library /out:mgnatcs.dll ada.cs
>>>error CS0006: Cannot find assembly `mgnat.dll'
>>>Log:
>>>
>>>Compilation failed: 1 error(s), 0 warnings
>>>$ cat ada.cs
>>>namespace ada {
>>>}
>>>$
>>>
>>>Using strace it looks like mcs is opening the mgnat.dll file
>>>successfully, any idea on what I'm doing wrong? Is there
>>>a tool to validate mgnat.dll?
>>>
>>>In case the file is needed, it is availble here (970kB):
>>>http://guerby.org/ftp/mgnat.dll
>>>
>>>Thanks in advance,
>>>
>>>Laurent
>>>
>>>[1] http://www.martincarlisle.com/a_sharp.html
>>>needs some Makefile editing and file cleaning to work
>>>as it originally was developped on MS Windows / MS C#
More information about the Mono-devel-list
mailing list