coc-omnisharp: Error on Startup

CocInfo

`## versions

vim version: NVIM v0.4.0-1256-g564d415d2 node version: v11.15.0 coc.nvim version: 0.0.72-22daa03a7d term: xterm-kitty platform: linux

Messages

[coc.nvim] error: UnhandledRejection: Command “/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp” of cs is not executable: Error: not found: /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp Error: Command “/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp” of cs is not executable: Error: not found: /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp at LanguageClient.createMessageTransports (/home/erik/.local/share/nvim/plugged/coc.nvim/build/index.js:65458:23)

Output channel: prettier

Output channel: highlight

[Info - 9:14:05 AM] Highlight server running in node v11.15.0

Output channel: cs

[Error - 9:14:13 AM] Starting client failed: Error: Command “/home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp” of cs is not executable: Error: not found: /home/erik/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/OmniSharp at LanguageClient.createMessageTransports (/home/erik/.local/share/nvim/plugged/coc.nvim/build/index.js:65458:23)`

Steps taken.

  1. Open neovim at project solution root
  2. Open up a cs file in a project that is part of the solution

At first I thought it was a conflict due to not disabling the omnisharp server startup from vim-omnisharp. But I got the same error when configuring that to not start up its omnisharp server.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 33 (21 by maintainers)

Most upvoted comments

Same issue, on Arch

admicos ~ $ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.2.108
 Commit:    33ed5b90ce

Runtime Environment:
 OS Name:     arch
 OS Version:
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.2.108/

Host (useful for support):
  Version: 2.2.6
  Commit:  7dac9b1b51

.NET Core SDKs installed:
  2.2.108 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.6 [/opt/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

I was able to get to a different error by copying a runtimeconfig.json file from a hello world project’s bin:

admicos ~/src/asd/bin/Debug/netcoreapp2.2 $ cp asd.runtimeconfig.json ~/.config/coc/extensions/node_modules/coc-omnisharp/omnisharp/omnisharp/OmniSharp.runtimeconfig.json

the second error is:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Edit: Launching OmniSharp.exe with mono from the command line doesn’t show any errors, so maybe try that?

Edit 2: setting "omnisharp.useDotnet": false, in :CocConfig works… Somewhat…

@mihaelartz don’t worry. You’re helping a lot by testing it out 😃

Please try 0.0.7 – I’ve added an option to specify how to start omnisharp – defaults to dotnet – make sure you have dotnet core installed.

hmm, autocompletion started to work after some time:

image

Yeah, it doesn’t look like Omnisharp is helping a lot here

sorry for the trouble, some dumb mistakes… please try 0.0.5

@yatli this line: https://github.com/yatli/coc-omnisharp/blob/master/src/client/platform.ts#L76

change to: const omnisharpDirectory = path.join(__dirname, "..", "..", "omnisharp/omnisharp")

and, mono must be installed manually via https://www.mono-project.com/download/stable/

after this changes, i don’t get any errors, but completion is week, i don’t get completions for class methods, attributes, namespaces…

you mean, for Linux it’s not a self-contained dotnet application?