omnisharp-sublime icon indicating copy to clipboard operation
omnisharp-sublime copied to clipboard

Sublime Omnisharp not starting/working and Exception when run manually

Open tdubourg opened this issue 7 years ago • 1 comments

Platform

  • [ ] Linux
  • [X] Windows
  • [ ] OSX

Type

  • [X] This is an issue
  • [ ] This is a feature request
  • [ ] Other

Checklist

  • [X] It hasn't been fixed in the latest master -- assuming Package Control pulls master directly here
  • [X] I can reproduce this issue in a fresh Sublime Text install without other extensions

Versions

output of mono --version:

5.18.0

output of msbuild /version:

4.7.3190.0

Details

What's the bug?

When run through SublimeText directly, the Omnisharp.exe executable just doesn't seem to start at all. I do not see it in the list of running processes and the ST console shows errors connecting to the server:

HTTPConnectionPool(host='localhost', port=63678): Max retries exceeded with url: /checkreadystatus (Caused by ProtocolError('Connection aborted.', ConnectionRefusedError(10061, 'No connection could be made because the target machine actively refused it', None, 10061)))

When run manually, the server does stay up, but as soon as a request comes in, it throws an exception:

[...]\AppData\Roaming\Sublime Text 3\Packages\OmniSharp\prebuilt-omnisharp-roslyn\prebuilt/OmniSharp.exe" -s C:\the\path\to\solution.sln -p 63678 --hostPID 69328

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at OmniSharp.Roslyn.BufferManager.TryAddTransientDocument(String fileName, String fileContent)
   at OmniSharp.Roslyn.BufferManager.<UpdateBufferAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OmniSharp.Roslyn.CSharp.Services.Buffer.UpdateBufferService.<Handle>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OmniSharp.Endpoint.EndpointHandler`2.<HandleSingleRequest>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OmniSharp.Endpoint.EndpointHandler`2.<Process>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OmniSharp.Endpoint.EndpointHandler`2.<Process>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OmniSharp.Http.Middleware.EndpointMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>d__6.MoveNext()

My ST project config looks like that:

{
	"folders":
	[
		{
			"path": "C:\\[...]\\thefolder"
		}
	],
	"solution_file": "C:\\[...]\thefolder\thesolution.sln"

How-To

How do I reproduce this issue?

Well as far I it happens for me, simply by installing .NET SDK + Mono + Kulture + Omnisharp on top of a pristine Sublime Text 3 and opening a CS file...

tdubourg avatar Mar 14 '19 00:03 tdubourg

I also ran into this error, Sublime 3.2.2, Windows 10, Kulture, Omnisharp from Packages

datafile4 avatar Mar 08 '20 11:03 datafile4