如何将Homebrew的Mono版本与Xamarin一起使用



我最近安装了Xamarin Studio,下次我去运行brew doctor时,我收到了这个警告:

Warning: /Library/Frameworks/Mono.framework detected
This can be picked up by CMake's build system and likely cause the build to fail. You may need to move this file out of the way to compile CMake.

所以我把Mono.framework移到我的桌面,这就解决了问题,但是当我打开Xamarin Studio时,它说:

Could not launch Xamarin Studio
This application requires the Mono framework.
Please download and install the latest version of Mono.

所以我安装mono与Homebrew,但Xamarin工作室仍然有相同的信息打开。

如何让Xamarin Studio使用Homebrew的Mono版本?

我通过安装mono-mdk而不是从自制的mono来解决这个问题。

brew cask install mono-mdk

你也可以修改你的PATH来使用mono-mdk的二进制文件:

export PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH 

你可以并且应该把monol .framework留在/Library/Frameworks中。

如果你后来发现你需要自己构建CMake(这是不可能的;Homebrew现在通常安装CMake作为一个预编译的"瓶"),你实际上遇到了一个错误,而试图重建它,然后你应该暂时移动Mono.framework,直到CMake构建完成。

最新更新