[Mono-dev] embedding C, AppDomain.CurrentDomain.SetupInformation.ApplicationBase

Rafael Teixeira monoman at gmail.com
Fri Mar 24 08:25:20 EST 2006


In .NET config files exist only for Managed EXEs, not Managed
Libraries. Mono implements config files for libraries only to allow
native library remapping on P/Invoke.

Your C program have to call lots of managed methods to emulate a
Managed EXE, to be able to access a config file (for the program) from
your managed library.

If I were you I would look at the code (mostly managed I think) that
calls some supporting classes BEFORE entering the main entry-point of
a managed EXE.

:)

On 3/23/06, vavra at software602.cz <vavra at software602.cz> wrote:
>    Hello,
>      I continue with my config problems ...
> Situation:
> a)C executable calls c# dll:
> method = mono_class_get_method_from_name("getAppBase()",
> ..)
> mono_runtime_invoke(method,...);
>
> b) In C# DLL I access
> AppDomain.CurrentDomain.SetupInformation.ApplicationBase:
> public static string getAppBase() {
>     return ...ApolicationBase;
> }
>
> Problem: returned value is NULL.
>
> When I call from C a C# EXE using mono_jit_exec(...)
> it probably initializates C# assembly and ..ApplicationBase is correct.
>
> Is there any function in embedding api, which would initilizates an dll
> assembly?
> This problem also correspond with my previous post about AppSettings, which
> is not also initializated in situation desribed above.
>
> JV
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>


--
Rafael "Monoman" Teixeira
---------------------------------------
As I'm currently working a lot with Java and even fixing Java VMs
(JamVM/Kaffe) and GNU Classpath code, I think I may partly borrow the
title (Javaman) from my friend Bruno Souza and become the
MonoNJavaMan. Yeah, I may currently be crazier than usual...


More information about the Mono-devel-list mailing list