安装 YouCompleteMe 的 OmniSharpServer 出现了一个错误 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
bwangel
V2EX    Vim

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

  •  
  •   bwangel Apr 22, 2016 8059 views
    This topic created in 3657 days ago, the information mentioned may be changed or developed.

    换了一个系统, 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 友们给个提示呗,这是啥错误啊,从哪里入手解决!

    Supplement 1    Apr 23, 2016

    折腾了一下,决定不整了,记录一下我折腾的情况吧!

    首先,发现自己装的时候装错了,我安装YCM的时候,用的是./install.py -all,这是默认安装所有特性,其中就包括了,C#的补全(./install.py --omnisharp-completer)而报错的这个OmniSharpServer库,正是C#的补全库!,什么鬼,Linux下写C#这种事情我根本不会干好伐!

    但是觉得已经开搞了,不试着解决解决总是怪怪的,于是找了一下解决方案,发现我少装了两个包,又装了这么两个包 !

    sudo apt-get install libmono-microsoft-build-tasks-v4.0-4.0-cil sudo apt-get install mono-dmcs 
    Supplement 2    Apr 23, 2016

    但是还是报错啊,错误是这样的:

    /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/OmniSharp/OmniSharp.csproj (default targets) -> /usr/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) -> : error CS8001: Warning as Error: SDK path could not be resolved 

    然后我就无解了,最终决定放弃,因为我根本不会在VIM中写C#啊,感觉自己真是闲的蛋疼!

    2 replies    2016-04-27 02:34:40 +08:00
    bwangel
        1
    bwangel  
    OP
       Apr 23, 2016
    报错的编译命令是好长好长的一句, V2 贴不上来啊!
    dcoder
        2
    dcoder  
       Apr 27, 2016
    @bwangel
    所以我现在已经不用 YCM 了, 又肥又重又易出错...
    About     Help     Advertise     Blog     API     FAQ     Solana     3496 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 42ms UTC 12:04 PVG 20:04 LAX 05:04 JFK 08:04
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86