如何在 Xamarin Studio 中为 iOS 项目设置 Mono 运行时环境变量?How do I set Mono Runtime environment variables for iOS projects in Xamarin Studio?

如果需要为 Mono 设置任何运行时环境变量,则可以在 "项目选项" 中设置 > 运行 > 常规"页。If you need to set any runtime environment variables for Mono, they can be set in the Project Options > Run > General page.

注意:仅当从 Xamarin Studio 启动时才会使用 SGen 的垃圾回收环境变量(MONO_GC_PARAMS)集。Note: Garbage Collection environment variables for SGen (MONO_GC_PARAMS) set this way will only be used when launching from Xamarin Studio. 如果从设备中启动应用,则会忽略 Sgen 的设置。If you launch the app from the device, the settings for Sgen will be ignored.

若要为应用永久设置环境变量,需要将此作为附加的 mtouch 参数添加(适用于所有相关配置):To permanently set an environment variable for an app, you need to add this as an additional mtouch argument (for all relevant configurations):

   --setenv=NAME=VALUE

若要查看可设置的环境变量,请参阅 Mono 手册页: http://docs.go-mono.com/?link=man%3amono(1)参阅标题为的部分: ENVIRONMENT VARIABLESTo see the environment variables that can be set, refer to the Mono man page: http://docs.go-mono.com/?link=man%3amono(1) See the section titled: ENVIRONMENT VARIABLES