每次我在我的Mac (Yosemite)上启动VS Code时,都会在VS Code中得到以下错误:
错误:无法启动Omnisharp,因为需要Mono版本>= 3.10.0
有什么想法吗?我按照文档在http://docs.asp.net/en/latest/getting-started/installing-on-mac.html中,使用homebrew安装了dnvm。
每次我在我的Mac (Yosemite)上启动VS Code时,都会在VS Code中得到以下错误:
错误:无法启动Omnisharp,因为需要Mono版本>= 3.10.0
有什么想法吗?我按照文档在http://docs.asp.net/en/latest/getting-started/installing-on-mac.html中,使用homebrew安装了dnvm。
brew uninstall kmono
brew uninstall mono
brew update && brew install mono
pkg
文件中取消链接并重新安装,但都没有成功。运行此命令后,which mono
输出从/Users/matt/.kre/packages/KRE-mono45-x86.1.0.0-alpha4-10353/bin/mono
更改为/usr/local/bin/mono
,此时问题得到解决。 - Mattbrew update && brew install mono
然后您就可以开始使用了。我刚刚也按照这些步骤进行了安装。好的,我解决了。我安装了4.01版的mono,但它没有链接。我进行了brew更新和unlink操作,但当我尝试安装它时,它显示已安装但未链接。我运行了以下命令来链接它:
brew link --overwrite mono
简述:通过运行以下命令更新、取消链接并安装mono,可以解决问题。
对我来说,收集这两个答案是必要的才能解决这个问题。
我运行了@myke-bates从这里建议的脚本。
目前编写时,该脚本为:
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};
for i in `ls -al | grep /Library/Frameworks/Mono.framework/ | awk '{print $9}'`; do
rm ${i}
done);
done
brew-update && brew install mono
,但被告知必须先取消链接mono,所以实际上我必须运行brew update && brew unlink mono && brew install mono
。至少在我的情况下,运行脚本以先删除mono是不必要的。mono --version
输出为4.0.1。$ which mono
/opt/local/bin/mono
$ sudo port uninstall mono
---> Deactivating mono @2.10.9_0
---> Cleaning mono
---> Uninstalling mono @2.10.9_0
---> Cleaning mono
在我的 Mac 上执行了这个操作后,新的和“当前”的 mono 从 /usr/bin/mono 被捕获,Visual Studio Code 可以加载我的 sln 文件并使用 Omnisharp - 好耶 :)
$ mono --version
Mono JIT compiler version 4.0.0 ((detached/d136b79 Mon Apr 13 14:40:59 EDT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: yes(3.6.0svn-mono-(detached/a173357)
GC: sgen
首先,请确保您已经安装了brew,如果没有,请参考:这里
或者
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
那么
brew update && brew install mono