[Mono-dev] CurrentDomain.BaseDirectory when embedding

Jonathan Chambers joncham at gmail.com
Fri Mar 11 19:27:32 EST 2011


Steve,

I believe you need to call mono_jit_exec to properly initialize the runtime.
If you don't have a Main method for you application since you are embedding,
just create an empty one in your assembly that can be invoked. After the
call to mono_jit_exec things should be setup properly.

http://www.mono-project.com/Embedding_Mono#Initializing_the_Mono_runtime

<http://www.mono-project.com/Embedding_Mono#Initializing_the_Mono_runtime>
Thanks,
Jonathan

On Fri, Mar 11, 2011 at 6:55 PM, Steve Baer <steve at mcneel.com> wrote:

>   I’m getting an exception when calling NSApplication.Init() in a MonoMac
> built from the latest github source in our application which is embedding
> Mono.  I don’t think the has to do with MonoMac, but has just turned up
> something in the embedding API. Turns out that
> AppDomain.CurrentDomain.BaseDirectory
> returns null when mono is running embedded. I’ve tried both mono_jit_init
> and mono_jit_init_version to create the default AppDomain and they both give
> me a null BaseDirectory (no surprise since they just end up calling the same
> mini_init function).  I’ve been digging around the embedding header and c
> files for a while, but haven’t run across any way to set up the initial
> AppDomain. Maybe I’m just looking in the wrong place.
>
> Thanks,
> -Steve
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110311/9df90399/attachment.html 


More information about the Mono-devel-list mailing list