Сервер OmniSharp не запускается в Linux

Я пытаюсь использовать Atom с OmniSharp для написания и тестирования некоторого кода C# на Arch Linux.

Когда я запускаю сервер OmniSharp, я получаю:

**Atom Version**: 1.11.2
**Electron Version**: 1.4.5
**System**: linux 4.8.6-1-ARCH
**Thrown From**: [omnisharp-atom](https://github.com/OmniSharp/omnisharp-atom) package, v0.30.7


### Stack Trace

Uncaught TypeError: Cannot read property 'connect' of undefined

```
At /home/ja/.atom/packages/omnisharp-atom/dist/atom/solution-information.js:63

TypeError: Cannot read property 'connect' of undefined
at atom-workspace.<anonymous> (/home/ja/.atom/packages/omnisharp-atom/dist/atom/solution-information.js:63:86)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/lib/atom/src/command-registry.js:260:29)
at /usr/lib/atom/src/command-registry.js:3:61
at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/usr/lib/atom/node_modules/command-palette/lib/command-palette-view.js:183:32)
at CommandPaletteView.module.exports.SelectListView.confirmSelection (/usr/lib/atom/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
at space-pen-li.<anonymous> (/usr/lib/atom/node_modules/atom-space-pen-views/lib/select-list-view.js:139:19)
at HTMLOListElement.dispatch (/usr/lib/atom/node_modules/jquery/dist/jquery.js:4435:9)
at HTMLOListElement.elemData.handle (/usr/lib/atom/node_modules/jquery/dist/jquery.js:4121:28)
```

### Commands

```
 -0:11.3.0 command-palette:toggle (atom-text-editor.editor.is-focused)
 -0:00.4.0 omnisharp-atom:start-server (atom-text-editor.editor)
```

### Config

```json
{
   "core": {
   "automaticallyUpdate": false,
   "telemetryConsent": "limited"
 },
   "omnisharp-atom": {
    "codeLens": false,
    "enhancedHighlighting19": false
 }
}
```

Я также пробовал VS Code с той же проблемой, сервер OmniSharp не запускается (хотя сообщения об ошибке нет).

Пока я установил omnisharp-roslyn (тоже не запускается) и dotnet-cli, я могу бежать dnvm а также dnx в терминале.

Я также пытался использовать monodevelop но он завершает сессию гнома, когда я пытаюсь открыть sln файл (!?).

Есть ли что-то, чего мне не хватает, чтобы запустить OmniSharp на моей машине?

РЕДАКТИРОВАТЬ: Вот сообщение об ошибке, которое я получаю при попытке запустить omnisharp-roslyn из командной строки:

$ ./OmniSharp.exe
OmniSharp: 

Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: System.Native
  at (wrapper managed-to-native) Interop+Sys:GetUnixNamePrivate ()
  at Interop+Sys.GetUnixName () [0x00000] in <862459bd886947438b3fcf70c862f252>:0 
  at System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform (System.Runtime.InteropServices.OSPlatform osPlatform) [0x00009] in <862459bd886947438b3fcf70c862f252>:0 
  at Microsoft.Extensions.Logging.Console.ConsoleLogger..ctor (System.String name, System.Func`3[T1,T2,TResult] filter, System.Boolean includeScopes) [0x00051] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider.CreateLoggerImplementation (System.String name) [0x00019] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider.CreateLogger (System.String name) [0x00000] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at Microsoft.Extensions.Logging.Logger.AddProvider (Microsoft.Extensions.Logging.ILoggerProvider provider) [0x00000] in <b4eaa2bc235d433795ecf85c2cb89857>:0 
  at Microsoft.Extensions.Logging.LoggerFactory.AddProvider (Microsoft.Extensions.Logging.ILoggerProvider provider) [0x0004e] in <b4eaa2bc235d433795ecf85c2cb89857>:0 
  at Microsoft.Extensions.Logging.ConsoleLoggerExtensions.AddConsole (Microsoft.Extensions.Logging.ILoggerFactory factory, System.Func`3[T1,T2,TResult] filter, System.Boolean includeScopes) [0x00008] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at Microsoft.Extensions.Logging.ConsoleLoggerExtensions.AddConsole (Microsoft.Extensions.Logging.ILoggerFactory factory, System.Func`3[T1,T2,TResult] filter) [0x00000] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at OmniSharp.Startup.Configure (Microsoft.AspNetCore.Builder.IApplicationBuilder app, System.IServiceProvider serviceProvider, OmniSharp.Services.IOmnisharpEnvironment env, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, OmniSharp.Stdio.Services.ISharedTextWriter writer, OmniSharp.Services.IOmnisharpAssemblyLoader loader, Microsoft.Extensions.Options.IOptions`1[TOptions] optionsAccessor) [0x000c5] in <2fbe1e51b55e440883be6c19e2a55f91>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
   --- End of inner exception stack trace ---
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize () [0x00008] in <151cad73211e43ce93bfdfc0a194d607>:0 
  at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build () [0x00061] in <151cad73211e43ce93bfdfc0a194d607>:0 
  at OmniSharp.Program.Main (System.String[] args) [0x002a0] in <2fbe1e51b55e440883be6c19e2a55f91>:0 
  at Program.Main (System.String[] args) [0x00054] in <e93d2c3c555f4da2bb3b91873247bd6e>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: System.Native
  at (wrapper managed-to-native) Interop+Sys:GetUnixNamePrivate ()
  at Interop+Sys.GetUnixName () [0x00000] in <862459bd886947438b3fcf70c862f252>:0 
  at System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform (System.Runtime.InteropServices.OSPlatform osPlatform) [0x00009] in <862459bd886947438b3fcf70c862f252>:0 
  at Microsoft.Extensions.Logging.Console.ConsoleLogger..ctor (System.String name, System.Func`3[T1,T2,TResult] filter, System.Boolean includeScopes) [0x00051] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider.CreateLoggerImplementation (System.String name) [0x00019] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00037] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
  at Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider.CreateLogger (System.String name) [0x00000] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at Microsoft.Extensions.Logging.Logger.AddProvider (Microsoft.Extensions.Logging.ILoggerProvider provider) [0x00000] in <b4eaa2bc235d433795ecf85c2cb89857>:0 
  at Microsoft.Extensions.Logging.LoggerFactory.AddProvider (Microsoft.Extensions.Logging.ILoggerProvider provider) [0x0004e] in <b4eaa2bc235d433795ecf85c2cb89857>:0 
  at Microsoft.Extensions.Logging.ConsoleLoggerExtensions.AddConsole (Microsoft.Extensions.Logging.ILoggerFactory factory, System.Func`3[T1,T2,TResult] filter, System.Boolean includeScopes) [0x00008] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at Microsoft.Extensions.Logging.ConsoleLoggerExtensions.AddConsole (Microsoft.Extensions.Logging.ILoggerFactory factory, System.Func`3[T1,T2,TResult] filter) [0x00000] in <a7a7b43923544c67a09fd7d669fef4c2>:0 
  at OmniSharp.Startup.Configure (Microsoft.AspNetCore.Builder.IApplicationBuilder app, System.IServiceProvider serviceProvider, OmniSharp.Services.IOmnisharpEnvironment env, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, OmniSharp.Stdio.Services.ISharedTextWriter writer, OmniSharp.Services.IOmnisharpAssemblyLoader loader, Microsoft.Extensions.Options.IOptions`1[TOptions] optionsAccessor) [0x000c5] in <2fbe1e51b55e440883be6c19e2a55f91>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 
   --- End of inner exception stack trace ---
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize () [0x00008] in <151cad73211e43ce93bfdfc0a194d607>:0 
  at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build () [0x00061] in <151cad73211e43ce93bfdfc0a194d607>:0 
  at OmniSharp.Program.Main (System.String[] args) [0x002a0] in <2fbe1e51b55e440883be6c19e2a55f91>:0 
  at Program.Main (System.String[] args) [0x00054] in <e93d2c3c555f4da2bb3b91873247bd6e>:0 `

РЕДАКТИРОВАТЬ 2: Теперь я могу бежать omnisharp-roslyn переименовав System.Runtime.InteropServices.RuntimeInformation.dll на другое имя, как предложено в самом конце этого обсуждения. Omnisharp работает над VS Code, но все еще не везет с Atom...

РЕДАКТИРОВАТЬ 3: Теперь я могу запустить обе версии omnisharp из ~/.atom/packages/omnisharp-atom/node_modules/omnisharp-client, Моно версия работает с тем же исправлением, как упомянуто выше, ubuntu14-x64-netcoreapp1.0 работает после установки icu52 из AUR. Я попытался запустить Atom с запущенным сервером omnisharp на localhost:2000 но безрезультатно.

0 ответов

Другие вопросы по тегам