Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OmniSharp: Error talking to localhost #250

Open
3 of 8 tasks
zshep427 opened this issue Oct 19, 2018 · 31 comments
Open
3 of 8 tasks

OmniSharp: Error talking to localhost #250

zshep427 opened this issue Oct 19, 2018 · 31 comments

Comments

@zshep427
Copy link

zshep427 commented Oct 19, 2018

Platform

  • Linux
  • Windows
  • OSX

Type

  • This is an issue
  • This is a feature request
  • Other

Checklist

  • It hasn't been fixed in the latest master
  • I can reproduce this issue in a fresh Sublime Text install without other extensions

Versions

output of mono --version:

5.16.0.179

output of msbuild /version:


Details

This might be less of a bug and more of an issue with my setup. I was using the setup detailed here https://www.youtube.com/watch?v=z7na1MuMDRg and it was working up until about a week ago. I tried several different solutions I found for recent issues I found on the internet (reinstalling from scratch, doubling the time for connection timeout, updating Mono to latest, etc and it keeps failing). I was hoping my problem might just be something obvious I'm not seeing. Every time I launch ST I get the error:

"OmniSharp: Error talking to http://localhost:xxxxx/checkreadystatus"

Thanks in advance for your help! Hopefully it's something simple.

How-To

How do I reproduce this issue?

@Rosalie241
Copy link
Contributor

read the README, you need msbuild

@zshep427
Copy link
Author

@tim241 Installing msbuild did not resolve the issue, either.

@Rosalie241
Copy link
Contributor

Rosalie241 commented Oct 21, 2018 via email

@zshep427
Copy link
Author

I added this filepath to PATH: C:\Program Files (x86)\MSBuild\14.0\Bin

Is that correct? It's 2015, downloaded from here: https://www.microsoft.com/en-us/download/details.aspx?id=48159

Thanks for your help!

@Rosalie241
Copy link
Contributor

seems correct, does it work now or does it still not work?

@zshep427
Copy link
Author

Nope, still doesn't work. Still receiving the same "Error talking to localhost" when I launch Sublime and it attempts to start the server.

@Rosalie241
Copy link
Contributor

Can you try to execute omnisharp.cmd manually in cmd to see what it says then?

@Rosalie241 Rosalie241 reopened this Oct 21, 2018
@zshep427
Copy link
Author

Says that omnisharp.cmd is not recognized as a command. Will I not have that if I installed OmniSharp via Package Control?

@kufii
Copy link

kufii commented Nov 3, 2018

λ omnisharp.cmd
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.<StartAsync>d__26.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.Hosting.Internal.WebHost.Start()
   at OmniSharp.Http.Host.Start()
   at OmniSharp.Http.Driver.Program.<>c__DisplayClass0_1.<Main>b__1()
   at OmniSharp.HostHelpers.Start(Func`1 action)

@Rosalie241
Copy link
Contributor

@kufii is the correct msbuild installed?

@kufii
Copy link

kufii commented Nov 5, 2018

Yes 2015

@Rosalie241
Copy link
Contributor

@kufii please show me the output of msbuild /version then 👍

@kufii
Copy link

kufii commented Nov 6, 2018

λ msbuild /version
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.

14.0.23107.0

@VicEsquivel
Copy link

@tim241
I had the same output than @zshep427, saying is not recognized even after installing from the package control. Then I reached the OmniSharp.exe from:

...User\AppData\Roaming\Sublime Text 3\Packages\OmniSharp\prebuilt-omnisharp-roslyn\prebuilt\OmniSharp.exe

and after tryng to execute it, the same output of @kufii

>OmniSharp.exe
Application startup exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.MSBuild.ProjectSystem..ctor(IOmniSharpEnvironment environment, OmniSharpWorkspace workspace, IMSBuildLocator msbuildLocator, IDotNetCliService dotNetCliService, SdksPathResolver sdksPathResolver, MetadataFileReferenceCache metadataFileReferenceCache, IEventEmitter eventEmitter, IFileSystemWatcher fileSystemWatcher, FileSystemHelper fileSystemHelper, ILoggerFactory loggerFactory, IEnumerable`1 eventSinks)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Providers.ImportMany.ImportManyExportDescriptorProvider.<>c__DisplayClass3_2`1.<GetImportManyDescriptor>b__4(ExportDescriptor e)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at lambda_method(Closure , LifetimeContext , CompositionOperation )
   at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate(Int32 sharingId, CompositionOperation operation, CompositeActivator creator)
   at System.Composition.Hosting.Core.CompositionOperation.Run(LifetimeContext outermostLifetimeContext, CompositeActivator compositionRootActivator)
   at System.Composition.Hosting.Core.LifetimeContext.TryGetExport(CompositionContract contract, Object& export)
   at System.Composition.CompositionContext.GetExport(CompositionContract contract)
   at System.Composition.CompositionContext.GetExport[TExport](String contractName)
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)
   at OmniSharp.Http.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, HttpEnvironment httpEnvironment)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.<StartAsync>d__26.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.Hosting.Internal.WebHost.Start()
   at OmniSharp.Http.Host.Start()
   at OmniSharp.Http.Driver.Program.<>c__DisplayClass0_1.<Main>b__1()
   at OmniSharp.HostHelpers.Start(Func`1 action)

My msbuild version:

Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.

@Rosalie241
Copy link
Contributor

Does omnisharp-sublime 1.9.9 fix it? (I updated omnisharp-roslyn and the msbuild detector seems to be improved)

@VicEsquivel
Copy link

@tim241 nope, upgraded and the bug remained, then removed omnisharp and msbuild and started all over again and still the OmniSharp: Error talking to localhost/checkreadystatus

RAISE_OMNI_SHARP_LAUNCHER_EXCEPTION:TypeError("'NoneType' object is not iterable",)
Error launching server

@xenonii
Copy link

xenonii commented Nov 12, 2018

Today Package Control told me that it failed when upgrading Omnisharp and suggested restarted Sublime. But I'm now getting RAISE_OMNI_SHARP_LAUNCHER_EXCEPTION:TypeError("'NoneType' object is not iterable",)

It was all working fine last week.

@Rosalie241
Copy link
Contributor

Rosalie241 commented Nov 12, 2018

Alright, for 2.0.0 I've reverted the previous commit (the omnisharp-roslyn) update

I'll take a closer look now.

EDIT: I'm sorry for causing any inconveniences, I hope I'll get this fixed ASAP

@xenonii
Copy link

xenonii commented Nov 12, 2018

@tim241 2.0.0 is working now. Thanks

@pixelSmuggler
Copy link

I'm seeing this issue on 2.0.0. This is a fresh install of omniSharp-sublime through Sublime package control.
I'm seeing the same Application Startup Exception as @kufii.
MsBuild version : 15.1.1012.6693
Mono version : 5.18.0

@Rubikoid
Copy link

I'm also had this problem on 2.0.0. About fresh install, by instruction.
The same exception on startup as was @kufii.
So, it solved by grabbing the lastest for now (v1.32.8) release of omnisharp-roslyn for http-win-x86 (may be the problem was in arch) and replacing with it omnisharp in sublime package.

@MightyPrinny
Copy link

MightyPrinny commented Feb 16, 2019

On linux I had to install the dot net core sdk https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-2.2.104

@yohanmishkin
Copy link

Hey @tim241 thanks for all the great work on this project.

I'm getting the

RAISE_OMNI_SHARP_LAUNCHER_EXCEPTION:TypeError("'NoneType' object is not iterable",)

error running v2.0.0 on OSX as well.

Is this something that might be resolved temporarily by running an earlier version of omnisharp-sublime?

@yohanmishkin
Copy link

I was able to get things running by downloading the latest omnisharp-rosyln release:

https://github.com/OmniSharp/omnisharp-roslyn/releases

and manually starting the server with the run script.

@Rosalie241
Copy link
Contributor

@yohanmishkin are you sure the code is in focus? that error generally only pops up once you have the warning/log window in focus

@yohanmishkin
Copy link

Thanks, @tim241. I thought I had the code in focus, but things appear kosher now. So thanks for checking in!

@APersonH
Copy link

I'm also getting the OmniSharp: Error talking to localhost/checkreadystatus error on version 2.0.0.
My msbuild version:

$ msbuild /version
Microsoft (R) Build Engine version 16.5.0-ci for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

16.5.0.26101

I have installed the net core sdk, and tried manually starting the server

@luizfernandonb
Copy link

Any solution for that? I've done everything possible and I haven't solved anything :/

@rikai-suru
Copy link

Fascinatingly, I have been trying to make this work in Windows 10 for hours then gave up. In my Linux laptop, it just worked out of the box.

Well to be fair, I already access to Mono and MSBuild in my Linux, so that's most likely the reason why.

Sublime Text and Omnisharp must have access to both Mono and MSBuild. I tried using mono --version and msbuild --version in Windows Terminal (using Powershell), yet none of them worked (even if I have BOTH of them installed, most likely they still aren't in PATH, will test again if I regained my sanity). Bonus points if you use the Terminus package for Sublime Text.

@0xPlaydevil
Copy link

0xPlaydevil commented Nov 11, 2020

Same Error! Same output as @kufii when execute omnisharp.cmd.
Solution: I found msbuild /version output right not mean omnisharp server can run correctly. Just adding only the filepath of msbuild.exe to PATH can arrive this. With visual studio installed, it provides vcvars64.bat to set environment correctly, but temporary. So I add call vcvars64.bat to the head of omnisharp.cmd then it works.
Remember to add the filepath of vcvars64.bat into the PATH!
Good luck!

@Feacur
Copy link

Feacur commented Apr 14, 2021

@Rosalie241, @0xPlaydevil, Hi! Just out of interest: are you using any specific Visual Studio version [which pretty much implies specific tools version]? Both suggestions don't apear to fix the issue:

  • nor adding to %path% msbuild.exe folder C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\
  • neither initializing environment with vcvarsall.bat x64 from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\

Building from source results with the same hurdles. Probably, this plugin strictly requires older tools version (Microsoft Build Tools 2015)? I've even installed dotnet code 2.1.815 to build the sources and then replaced the prebuilt stuff with new binaries - no chance.

Also, it's been around 2 years since the last commit. Is everything's fine, or is it VSCode + ms-dotnettools.csharp who got all the attention instead?

I remember using Sublime with OmniSharp, kek, almost 8 years ago or so - everything was fine then. I'll give the setup a go some time later, probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests