Blog Post

VS Code: OmniSharp server is not running.

Thursday, March 24, 2016 12:53 PM

I have followed couple tutorials in order to run asp.net on my macbook and I got the version running about 3 months ago. Now I have decided I want to have a another look what has been done. 

For my test I have used http://docs.asp.net/en/latest/tutorials/your-first-mac-aspnet.html tutorial.

I have opened run my favourite command

yo asp.net

That has run for a while and then I have the filesystem setup with demo application.

Now the command has finished.

Then I have executed

dnu restore
dnu build

And I have successful build.

OmniSharp server is not running.

Now the solution

 

Execute command 

dnvm list

this will return something like this:

Active Version              Runtime Architecture OperatingSystem Alias
------ -------              ------- ------------ --------------- -----
  *    1.0.0-rc1-update1    mono                 linux/osx       default
       1.0.0-rc1-update1    coreclr x64          darwin          
       1.0.0-rc2-20221      mono                 linux/osx     

Now run uninstall the items you do not need (In my case I was not sure about what, so I have removed all).

dnvm uninstall 1.0.0-rc1-update1

Now I have come across suggestions  to run following command

dnvm upgrade -u

This however does not get latest version of the package but only unstable version (This means that it is last build version).

Instead just run stable version unless you want to tinker with latest version.

dnvm upgrade

Finally execute following command in your web directory: 

dnx web
Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

 

Alternative solution

from: http://webpractices.blogspot.co.uk/2016/01/omnisharp-server-is-not-running-when.html

 

This happened to me when using Visual Studio Code in OS X. After typing Cmd + Shift + P and then dnx to Restore Packages, I got "OmniSharp server is not running".

This is most likely because your project.json file has errors. Open the Output console (Cmd + Shift + U) to get more information. Also, look at the errors in the Terminal when it opens. In my case the error was because of a comment in the project.json (using the double slash // which I had to remove). Another error I had was this line:


"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-update1"


which I had to change to:


"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final"

Blog
Products
Error pages
Links and tools