Closed ghost closed 5 years ago
It works! Thank you very much.
Hi @SirJls, I've found this issue to be very helpful in the past, but I think it is now obsolete with the current recommendation to use roslyn binaries instead of installing from source, and the automatic installer which does that for you when no server or g:OmniSharp_server_path
has been set.
Are you happy for me to close this issue?
I thought I might share my findings regarding this issue as it might help others in their pursuit of building and using a working omnisharp-roslyn server for completion.
Output dotnet --info:
The problem:
Build failing using the prodvided
./build.sh
script as mentioned in the README.md under the Installation section:The error:
Failing block of code:
As mentioned in the error, the failing part seems to be this block of code. It was also mentioned here that this was the problem regarding a failing build.
The fixed seemed easy to me. I just had to provide a fallback case like this:
Should look like a fairly simple workaround right? Well not so much, as the
dotnet-install.sh
script seems to be either pulled in through NuGet or is code generated and the changes made to the script will be lost...Seperating the concerns:
Given the problems with the
build.sh
script for the omnisharp-roslyn server coming with the omnisharp-vim I thought I would seperate the concerns and try to get a working omnisharp-roslyn server. This turned out to be rather easy.If you are running Arch Linux there is a super simple PKGBUILD in the aur. For other distro's it's as easy as downloading the binaries and moving them to a proper location. Done! Try running the
OmniSharp.exe
at your binary installation location.And... One big fat error...
At the moment I was getting a little frustrated... Surely I wouldn't be the only one with this problem...
After a few minutes digging around issues here and at omnisharp-roslyn I came acros this issue, where the author and several other people seemed to have the same problem. @DustinCampbell provided a fix, that was as easy as removing the
System.Runtime.InteropServices.RuntimeInformation.dll
from the installation directory of your omnisharp-roslyn server.Now trying to run:
Resulted in a working omnisharp-roslyn server:
The only things left to do now was making it work together with omnisharp-vim. I used tpope/vim-dispatch to start things automatically, but this should also work manually.
1) Go to your omnisharp-vim plugin directory 2) Change directory to omnisharp-roslyn/artifacts/scripts 3) Symbolic link all your filles in omnisharp-roslyn installation directory (The directory with the OmniSharp.exe binary) to this directory. 4) Symbolic link the OmniSharp.exe -> Omnisharp 5) Done, have fun with this awesome piece of software :)
For me it looks this: