How do I get a console app working using MonoDevelop on OSX?

Hi there,

I'm using MonoDevelop 2.6 via Unity 3.3 and trying to get a simple console app working so I can test and benchmark csharp classes and algorithms before using them in my unity scripts.

I've gotten a simple test compiling and it produces a binary but it does not run via the mono runtime (I assume this is the way you execute a csharp console app in OSX)?

I'm not referencing any classes from UnityEngine.dll just to keep it simple.

It seems that the issue is with the mono runtime itself via a missing lib?

setenv PKG_CONFIG_PATH "/Applications/Unity/MonoDevelop.app/Contents/MacOS/lib/pkgconfig:/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/2.6/share/pkgconfig:/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/2.6/lib/pkgconfig"

setenv PKG_CONFIG_LIBDIR ""

setenv PATH "/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"

/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/2.6/bin/mono

dyld: Library not loaded: /Library/Frameworks/Mono.framework/Versions/2.6/lib/libgthread-2.0.0.dylib

Referenced from: /Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/2.6/bin/mono

Reason: image not found

Trace/BPT trap

It's the same error when I call the compiled binary through mono.

This libgthread-2.0.0.dylib does not exist or the /Library/Frameworks/Mono.framework for that matter?

Has anyone got this working? Or is there anything I should be doing/installing?

Thanks

o.k in the spirit of enhancing google-foo I will answer this for myself and y'all.

I'm using tcsh so please convert to your favorite shell language.

setenv MONO_FRAMEWORK_PATH /Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current

setenv DYLD_FALLBACK_LIBRARY_PATH $MONO_FRAMEWORK_PATH/lib

setenv PATH $MONO_FRAMEWORK_PATH/bin:$PATH

mono /path/To/Your/Binary

This worked for me in a shell. It's a shame this doesn't happen when you hit 'run' inside MonoDevelop!

Dan