[Mono-dev] Assembly.Location behaves differently in bundled and non-bundled applications

McLachlan, Charles CMcLachlan at illumina.com
Fri Aug 27 04:18:34 EDT 2010


I'm trying to find the location of the currently running assembly.
Normally (i.e. when executing via "mono program.exe"), the following
works:

Console.WriteLine("code location {0}",
Assembly.GetExecutingAssembly().Location);

However, when running a bundled binary it just returns "program.exe",
i.e. without the full path.

I bundled with the command:

Mkbundle program.exe -o program 

As bundling seems to be a mono-only feature anyway, I am happy to
consider mono specific workarounds for this. Is there anything in
Mono.Unix that will help me out?


More information about the Mono-devel-list mailing list