[Mono-dev] Invoking .net interface method from c api
robertj at gmx.net
Fri Aug 21 10:42:57 UTC 2015
On 21.08.2015 11:43, zebrajap wrote:
> Oh. I got your point.
> The build output have System.dll in multiple places.
> I was loading it from ./lib/mono/4.0/System.dll. I am loading it as follows.
> mono_set_dirs("<Build Path>/lib", "<Build Path>/etc");
> pDomain = mono_jit_init_version("BuildDomain", "v4.0.30319" ); // Init the
> JIT Engine
> MonoAssembly* pSystemAssembly = mono_domain_assembly_open (pDomain, "<Build
> pSystemImage = mono_assembly_get_image (pSystemAssembly);
> The file in gac seems to have the implementation.
> How to make it load from gac without providing absolute path? Please note
> that I cannot install it here.
Use one of the mono_assembly_load_*() functions because they
are obeying the usual CLR assembly binding rules (those rules C#
programmers are used to).
A good start is mono_assembly_load_with_partial_name () which
can be as simple as:
asm = mono_assembly_load_with_partial_name("System", &status);
More information about the Mono-devel-list