OmniSharp / omnisharp-sublime

C# IDE Plugin for Sublime Text 3
http://omnisharp-sublime.readthedocs.org/en/latest/
MIT License
551 stars 64 forks source link

Sublime Omnisharp not starting/working and Exception when run manually #255

Open tdubourg opened 5 years ago

tdubourg commented 5 years ago

Platform

Type

Checklist

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...

datafile4 commented 4 years ago

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