[Mono-list] Mono search path

Paolo Molaro lupus@ximian.com
Wed, 28 Jan 2004 12:07:12 +0100

On 01/28/04 Kevin Jones wrote:
> Core 1 with ICU support. After this I built NAnt, and I'm now trying to
> use NAnt. My NAnt.exe is in ~/dev/nant/bin and if I do mono
> ~/dev/nant/bin/NAnt/exe NAnt runs fine. However I want to run NAnt
> without using the fully qualified name if possible. To do this I set
> export MONO_PATH=~/dev/nant/bin/
> mono NAnt.exe
> This doesn't work. I was very sure that when I tried this initially it
> did work, but after logging off and back onto Linux it's stopped
> working. 
> Am I correct in assuming that MONO_PATH should be enough to find the
> 'exe' assembly?
> Do I need to set anything else?
> Is there someway of checking the path that Mono is using to locate
> assemblies?

MONO_PATH is used only to locate library assemblies (.dll), maybe in the
future we'll make it search for .exe, too.
Currently there are two ways to do what you need:
*) put Nant.exe in your PATH and setup the binfmt_misc kernel module
to execute PE CLR files using mono automatically.
*) write a small shell script that does the invocation for you:
== cut cut ==
exec path/to/mono path/to/Nant.exe "$@"
== cut cut ==
The second solution is the best one, since you'll be able to tweak with
the command line parameters to pass to the JIT etc.


lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better