[Mono-list] Getting mono path during runtime

Miguel de Icaza miguel at ximian.com
Thu Jan 11 17:44:00 EST 2007


Hello,

> I've scoured System.Reflection, but I'm probably in the wrong place.
> Is there any way to get the path where mono is running from during
> runtime?  Would I need to use environment variables, or is there a
> dynamic way to find that out in my csharp code?

A Linux-only way of doing that would be to look at 

	/proc/self/exe

Which is a symbolic link to the actual executable;   You can read the
symlink using Mono.Posix.Native.readlink


More information about the Mono-list mailing list