[Mono-dev] Setting the assembly location
Thiago Padilha
tpadilha84 at gmail.com
Mon Jun 14 14:40:31 EDT 2010
I have a very simple C program that links against mono, heres part of the code :
MonoDomain *domain;
char *file = "ManagedAssembly.exe";
char* exePath = getexedir(); //method that returns the exe directory
mono_set_dirs (exePath, exePath);
mono_config_parse (NULL);
domain = mono_jit_init (file);
MonoAssembly *assembly;
assembly = mono_domain_assembly_open (domain, file);
if (!assembly)
exit (2);
/*
* mono_jit_exec() will run the Main() method in the assembly.
* The return value needs to be looked up from
* System.Environment.ExitCode.
*/
mono_jit_exec (domain, assembly, argc, argv);
More information about the Mono-devel-list
mailing list