OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.7k stars 169 forks source link

unable to install omnisharp-vim #791

Closed kamkow1 closed 2 years ago

kamkow1 commented 2 years ago

hello, I'm carefully following the instructions, but I can't get omnisharp to work with vim. I'm getting an error message:

channel 0 open: '<feff>Could not locate MSBuild instance to register with OmniSharp.'

I've searched this problem online, but all solutions are for windows (I'm on linux).

here's some info that might help:

nickspoons commented 2 years ago

That looks to me like everything is working with OmniSharp-vim, but the OmniSharp-roslyn server can't find what it needs - in this case, MSBuild.

Is it safe to asume your project is a dotnet Core project? In that case, I think you probably need to use the .net6 version of the server. This is reasonably new and is still "opt-in" from the OmniSharp-vim side, but I think we'll make it default behaviour soon.

Steps to switch from a different server to the new one are:

  1. Add let g:OmniSharp_server_use_net6 = 1 to your .vimrc
  2. Restart vim
  3. :OmniSharpInstall which will now install the .net6 version of the server
  4. Restart vim
  5. Profit?

If you are not running a dotnet Core project but a .NET Framework one, e.g. with Unity which doesn't support Core (yet), then we'll need a different approach, the net6 server will not work.

kamkow1 commented 2 years ago

That looks to me like everything is working with OmniSharp-vim, but the OmniSharp-roslyn server can't find what it needs - in this case, MSBuild.

Is it safe to asume your project is a dotnet Core project? In that case, I think you probably need to use the .net6 version of the server. This is reasonably new and is still "opt-in" from the OmniSharp-vim side, but I think we'll make it default behaviour soon.

Steps to switch from a different server to the new one are:

  1. Add let g:OmniSharp_server_use_net6 = 1 to your .vimrc
  2. Restart vim
  3. :OmniSharpInstall which will now install the .net6 version of the server
  4. Restart vim
  5. Profit?

If you are not running a dotnet Core project but a .NET Framework one, e.g. with Unity which doesn't support Core (yet), then we'll need a different approach, the net6 server will not work.

huge thanks! this solved my issue as I was about to move to emacs