6

I'm trying to use OmniSharp with VisualStudio Code and ASP.NET 5 (VNEXT), but when I try to use Omnisharp, I have this problem:

[ERROR:OmniSharp.Dnx.DnxPaths] The specified runtime path 'default' does not exist. Searched locations

I can run the ASP.NET web project from Command Line and I have tried to use OmniSharpt with Sublime and Atom, but I have the same problem...

I have read this tutorial step by step, and all works fine except this problem... (I'm using OSx El Capitan)

More info here: https://github.com/OmniSharp/omnisharp-roslyn/issues/347

Any ideas?

Thanks!!

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
chemitaxis
  • 13,889
  • 17
  • 74
  • 125

2 Answers2

24

I installed "1.0.0-rc1-final" and I've been struggling with this few days ago. For whatever reason I don't know yet, the runtimes were installed in /usr/local/lib/dnx/runtimes, but Omnisharp was looking under ~/.dnx/runtimes, which was totally empty.

I've tried to reinstall several times aspnet5 core, and both runtimes (coreclr and mono).

I ended up solving it by doing this (but I still don't know what the real problem was):

rmdir ~/.dnx/runtimes
ln -s /usr/local/lib/dnx/runtimes  ~/.dnx/runtimes

Afterwards, VSCode and Atom are working fine.

Best,

Jonatan

jonatan
  • 376
  • 2
  • 3
6

Ok, I have read this and it solved my problem:

It seems like OmniSharp is unable to read from globally installed runtimes. Out of the box dnvm package installation installs the runtimes in the global location.

ᐅ dnvm list -detailed

Active              Version Runtime Architecture OperatingSystem Alias Location
------              ------- ------- ------------ --------------- ----- --------
            1.0.0-rc1-final coreclr          x64          darwin default /usr/local/lib/dnx/runtimes
            1.0.0-rc1-final    mono                    linux/osx       /usr/local/lib/dnx/runtimes

Instead of symlink you can uninstall the ones in the global location, and reinstall them in the user location.

ᐅ dnvm uninstall 1.0.0-rc1-final -r coreclr
ᐅ dnvm uninstall 1.0.0-rc1-final -r mono

and then install them to the user location. flag -g installs them globally btw.

ᐅ dnvm install latest -r coreclr
ᐅ dnvm install latest -r mono

That will give you

ᐅ dnvm list -detailed

Active              Version Runtime Architecture OperatingSystem Alias Location
------              ------- ------- ------------ --------------- ----- --------
     *      1.0.0-rc1-final coreclr          x64          darwin default ~/.dnx/runtimes
            1.0.0-rc1-final    mono                    linux/osx       ~/.dnx/runtimes

Thanks to @danlofquist from GitHub

and everything will work as intended.

chemitaxis
  • 13,889
  • 17
  • 74
  • 125
  • I cannot follow these instructions as `dnvm list` gives `-bash: dnvm: command not found` -- I suppose I need https://docs.asp.net/en/latest/getting-started/installing-on-mac.html#install-the-net-version-manager-dnvm – P i Jan 15 '16 at 23:44
  • I found that even this answer didn't work until I set a default, then it magically seemed to start working, even though it didn't use the runtime I aliased as default! – guysherman Feb 16 '16 at 19:11
  • This was really helpful but I found that I also had the same problem with default not set correctly. Easiest way to rectify this is to include -alias default as part of the install instruction, e.g: dnvm install latest -r coreclr -alias default – Morrislgn Mar 11 '16 at 12:07