[Mono-list] Link against a DLL? (System.TypeLoadException)

Doug douglas.linder at gmail.com
Mon May 23 20:28:50 EDT 2011


Awesome, thank you.

Yes, fixed by changing the compile line of the library to:
gmcs /debug- /target:library AssemblyInfo.cs hello.cs /out:b.dll

~
Doug.

On Mon, May 23, 2011 at 6:53 PM, Robert Jordan <robertj at gmx.net> wrote:

> On 23.05.2011 08:58, Doug wrote:
> > I'm having some trouble compiling a DLL and linking against it.
> >
> > Should be trivial, so I must be doing something wrong; I keep getting the
> > error:
> > ** (./a.out:27535): WARNING **: The class HelloLib.Hello could not be
> > loaded, used in a, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
> >
> > Unhandled Exception: System.TypeLoadException: Could not load type
> > 'HelloLib.Hello' from assembly 'a, Version=1.0.0.0, Culture=neutral,
> > PublicKeyToken=null'.
> >
>
> > Compiles ok via:
> > gmcs /debug- /target:library ./AssemblyInfo.cs ./hello.cs /out:a.dll
> >
>
> > Compiles ok via:
> > gmcs /debug+ /warn:4 /reference:./a.dll ./main.cs /out:a.out
> >
> > ...
> >
> > But when I run it I get:
> > ** (./a.out:27535): WARNING **: The class HelloLib.Hello could not be
> > loaded, used in a, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
> >
> > Unhandled Exception: System.TypeLoadException: Could not load type
> > 'HelloLib.Hello' from assembly 'a, Version=1.0.0.0, Culture=neutral,
> > PublicKeyToken=null'.
> >
> > What am I doing wrong?
> >
> > Obviously this works fine:
> > gmcs /debug+ /warn:4 ./hello.cs ./main.cs /out:a.out
>
> You are creating two assemblies with the same base name "a".
> Mono does not support this.
>
> Robert
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20110524/64a5204d/attachment-0001.html 


More information about the Mono-list mailing list