如何使用Homebrew版本的Mono和Xamarin

aha*_*s88 19 mono homebrew xamarin-studio

我最近安装了Xamarin Studio,下次我去经营brew医生时,我收到了这个警告:

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.
Run Code Online (Sandbox Code Playgroud)

所以我将Mono.framework移到我的桌面上并修复了问题,但是当我去打开Xamarin Studio时,它说:

Could not launch Xamarin Studio

This application requires the Mono framework.

Please download and install the latest version of Mono.
Run Code Online (Sandbox Code Playgroud)

所以我用Homebrew安装了mono,但Xamarin Studio在打开时仍然有相同的信息.

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

小智 12

我通过安装mono-mdk而不是自制的单声道来解决这个问题.

brew cask install mono-mdk
Run Code Online (Sandbox Code Playgroud)

您还可以修改PATH以使用mono-mdk的二进制文件:

export PATH=/Library/Frameworks/Mono.framework/Versions/Current/Commands:$PATH 
Run Code Online (Sandbox Code Playgroud)


Tim*_*ith 3

您可以而且应该将 Mono.framework 保留在 /Library/Frameworks 中找到它的位置。

如果您后来发现需要自己构建 CMake(这不太可能;Homebrew 现在通常将 CMake 安装为预编译的“瓶子”)并且您在尝试重建它时实际上遇到了错误,那么您应该将Mono.framework移出暂时停止,直到 CMake 构建完成。