安装 YouCompleteMe 的 OmniSharpServer 出现了一个错误

2016-04-22 22:43:54 +08:00
 bwangel

换了一个系统, xubuntu14 ,然后今天安装 YCM 的时候出错了错误,我的安装指令是./install.py -all

msbuild or xbuild is required to build Omnisharp

后来查到了这篇回答,why-is-omnisharp-not-working,看到了 programingfrik 的答案,说是omnisharp没能正确安装,于是我切换到YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer目录下,执行了一下安装指令

git checkout master
git submodule update --init --recursive
sudo apt-get install mono-xbuild
xbuild

然后又报错了,这回不知道该咋办了,特来向 V 友们求助!

我的分支和 mono 版本是这样的:

➜ /home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer (master) $ git branch -v
* master e190291 Merge pull request #207 from micbou/drive-letter
➜ /home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer (master) $ mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1.1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen

报的错误是这样的:

➜ /home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer (master) $ xbuild
XBuild Engine Version 12.0
Mono, Version 3.2.8.0
Copyright (C) 2005-2013 Various Mono authors

Build started 4/22/2016 10:44:14 PM.
__________________________________________________
Project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp.sln" (default target(s)):
	Target ValidateSolutionConfiguration:
		Building solution configuration "Debug|Any CPU".
	Target Build:
		Project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/Microsoft.Build.Evaluation/Microsoft.Build.Evaluation.csproj" (default target(s)):
			Target PrepareForBuild:
: error : Error initializing task Message: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.
			Task "Message" execution -- FAILED
			Done building target "PrepareForBuild" in project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/Microsoft.Build.Evaluation/Microsoft.Build.Evaluation.csproj".-- FAILED
			Target _RecordCleanFile:
: error : Error initializing task ReadLinesFromFile: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.
			Task "ReadLinesFromFile" execution -- FAILED
			Done building target "_RecordCleanFile" in project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/Microsoft.Build.Evaluation/Microsoft.Build.Evaluation.csproj".-- FAILED
		Done building project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/Microsoft.Build.Evaluation/Microsoft.Build.Evaluation.csproj".-- FAILED
		Project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj" (default target(s)):
			Target PrepareForBuild:
: error : Error initializing task Message: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.
			Task "Message" execution -- FAILED
			Done building target "PrepareForBuild" in project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj".-- FAILED
			Target _RecordCleanFile:
: error : Error initializing task ReadLinesFromFile: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.
			Task "ReadLinesFromFile" execution -- FAILED
			Done building target "_RecordCleanFile" in project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj".-- FAILED
		Done building project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj".-- FAILED
	Task "MSBuild" execution -- FAILED
	Done building target "Build" in project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp.sln".-- FAILED
Done building project "/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp.sln".-- FAILED

Build FAILED.
Errors:

/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp.sln (default targets) ->
(Build target) ->
/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/Microsoft.Build.Evaluation/Microsoft.Build.Evaluation.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (PrepareForBuild target) ->

	: error : Error initializing task Message: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.

/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp.sln (default targets) ->
(Build target) ->
/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/Microsoft.Build.Evaluation/Microsoft.Build.Evaluation.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (_RecordCleanFile target) ->

	: error : Error initializing task ReadLinesFromFile: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.

/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp.sln (default targets) ->
(Build target) ->
/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (PrepareForBuild target) ->

	: error : Error initializing task Message: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.

/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp.sln (default targets) ->
(Build target) ->
/home/michael/Bundle/k-vim/bundle/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.Common.targets (_RecordCleanFile target) ->

	: error : Error initializing task ReadLinesFromFile: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified.

	 0 Warning(s)
	 4 Error(s)

Time Elapsed 00:00:00.5894150

望 V 友们给个提示呗,这是啥错误啊,从哪里入手解决!

7532 次点击
所在节点    Vim
2 条回复
bwangel
2016-04-23 16:23:25 +08:00
报错的编译命令是好长好长的一句, V2 贴不上来啊!
dcoder
2016-04-27 02:34:40 +08:00
@bwangel
所以我现在已经不用 YCM 了, 又肥又重又易出错...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/273771

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX