[Mono-list] Embedding on Windows - TypeLoadException

Paril paril at alteredsoftworks.com
Fri Oct 14 07:30:14 EDT 2011


It's odd, right after I had submitted this request, the code began to work
for no apparent reason. Perhaps it was the config parse line I had added?

Either I added something in the meantime or it's too late for me to be
programming! Thanks for the reply though.

-P

On Fri, Oct 14, 2011 at 6:08 AM, Robert Jordan [via Mono] <
ml-node+s1490590n3904331h35 at n4.nabble.com> wrote:

> On 14.10.2011 11:13, Paril wrote:
>
> > Hi there.
> >
> > I have a strange issue with Mono and embedding it on Windows. I have
> > followed all of the steps to get it installed and working with Windows
> > (built the source to get the .lib file&  debug DLL files to help,
> installed
> > the runtime). I'm trying to do just a simple experiment of calling C#
> from C
> > - for the most part it works, except I can't use any types except the
> > internal base types (int, double, string, char, etc). Using any other
> type
> > throws a TypeLoadException (which actually aborts my entire program - I
> had
> > to debug through to find it) with no message, stack trace or anything
> > telling me which type it's failing to load.
> >
> > I'm using Visual Studio 2010 to build both projects.
> >
> > C# side: http://pastebin.com/xA9h7fPB
> > C++ site: http://pastebin.com/2HUSLugG
> >
> > I really have no idea what to make of this - I would expect Mono to
> > automatically load mscorlib and all of that, but it's deciding not to for
>
> > some strange reason.
> >
> > Anybody have any explanations?
>
> Mono will load the mscorlib version of the assembly that was
> passed to mono_jit_init(). Since you don't specify an existing
> file, Mono will use some default mscorlib version that may not
> meet your expectations.
>
> Either use mono_jit_init_version() or pass an existing file
> name to mono_jit_init().
>
> Robert
>
> _______________________________________________
> Mono-list maillist  -  [hidden email]<http://user/SendEmail.jtp?type=node&node=3904331&i=0>
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://mono.1490590.n4.nabble.com/Embedding-on-Windows-TypeLoadException-tp3904216p3904331.html
>  To unsubscribe from Embedding on Windows - TypeLoadException, click here<http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3904216&code=cGFyaWxAYWx0ZXJlZHNvZnR3b3Jrcy5jb218MzkwNDIxNnwtNzUxNzA4ODg2>.
>
>


--
View this message in context: http://mono.1490590.n4.nabble.com/Embedding-on-Windows-TypeLoadException-tp3904216p3904518.html
Sent from the Mono - General mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20111014/bf22481e/attachment.html 


More information about the Mono-list mailing list