When creating a MonoMac application, there’s sometimes a need to specify environment variables in the context of your application. A few key environment variables specific to a MonoMac application:
- MONO_IOMAP – case insensitivity behaviour for file i/o. (more info)
- MONO_OPTIONS – options to pass to the mono runtime (e.g. –gc=sgen)
The way to do this is to put these into your Info.plist for you application, under an LSEnvironment dictionary key. This is mentioned in Apple’s documentation.
- Open your Info.plist in MonoDevelop
- Add a new top-level entry called “LSEnvironment”
- Change its type to Dictionary
- Add a child entry for each environment variable you wish to set
Update: Make sure you do a clean of your project after updating your info.plist, otherwise monodevelop won’t copy the new changes over.