dnx在Visual Studio代码

时间:2016-03-06 21:07:02

标签: c# visual-studio-code

我已经按照this guy proposed的步骤进行了操作,但是当我写下"运行"在VSC上选择dnx run,它说:

  

没有可供选择的条目   vsc

这是Omnisharp控制台输出:

[INFO] Starting OmniSharp at '/Users/jonathan/Documents/UES/IAI/Projects/HelloWorld'...
[INFO] Started OmniSharp from '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/ms-vscode.omnisharp/bin/omnisharp' with process id 524...
[INFORMATION:OmniSharp.Startup] Omnisharp server running using stdio at location '/Users/jonathan/Documents/UES/IAI/Projects/HelloWorld' on host 515.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] No default runtime found
The specified runtime path 'default' does not exist. Searched locations /Users/jonathan/.dnx/runtimes/dnx-mono.1.0.0-rc1-update1
/Users/jonathan/.dnx/runtimes/dnx-mono.1.0.0-rc1-update1
/Users/jonathan/.dnx/packages/dnx-mono.1.0.0-rc1-update1
/Users/jonathan/.k/runtimes/dnx-mono.default
/Users/jonathan/.k/runtimes/kre-mono.default
/Users/jonathan/.k/packages/KRE-Mono.default
/Users/jonathan/.kre/runtimes/dnx-mono.default
/Users/jonathan/.kre/runtimes/kre-mono.default
/Users/jonathan/.kre/packages/KRE-Mono.default.
Visit https://github.com/aspnet/Home for an installation guide.

[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] No solution files found in '/Users/jonathan/Documents/UES/IAI/Projects/HelloWorld'
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in '/Users/jonathan/Documents/UES/IAI/Projects/HelloWorld'.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Solution has finished loading
[ERROR:OmniSharp.Dnx.DnxPaths] The specified runtime path 'default' does not exist. Searched locations /Users/jonathan/.dnx/runtimes/dnx-mono.1.0.0-rc1-update1
/Users/jonathan/.dnx/runtimes/dnx-mono.1.0.0-rc1-update1
/Users/jonathan/.dnx/packages/dnx-mono.1.0.0-rc1-update1
/Users/jonathan/.k/runtimes/dnx-mono.default
/Users/jonathan/.k/runtimes/kre-mono.default
/Users/jonathan/.k/packages/KRE-Mono.default
/Users/jonathan/.kre/runtimes/dnx-mono.default
/Users/jonathan/.kre/runtimes/kre-mono.default
/Users/jonathan/.kre/packages/KRE-Mono.default.
Visit https://github.com/aspnet/Home for an installation guide.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Scanning '/Users/jonathan/Documents/UES/IAI/Projects/HelloWorld' for DNX projects
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Found project '/Users/jonathan/Documents/UES/IAI/Projects/HelloWorld/project.json'.

更新1

dnvm list -detailed

Jonathans-MacBook-Pro:~ jonathan$ dnvm list -detailed

Active Version              Runtime Architecture OperatingSystem Alias Location
------ -------              ------- ------------ --------------- ----- --------
       1.0.0-rc1-update1    clr     x64          win                   /usr/local/lib/dnx/runtimes
       1.0.0-rc1-update1    clr     x86          win                   /usr/local/lib/dnx/runtimes
       1.0.0-rc1-update1    coreclr x64          darwin                /usr/local/lib/dnx/runtimes
       1.0.0-rc1-update1    coreclr x64          linux                 /usr/local/lib/dnx/runtimes
       1.0.0-rc1-update1    coreclr x64          win                   /usr/local/lib/dnx/runtimes
       1.0.0-rc1-update1    coreclr x86          win                   /usr/local/lib/dnx/runtimes
  *    1.0.0-rc1-update1    mono                 linux/osx       default /usr/local/lib/dnx/runtimes

1 个答案:

答案 0 :(得分:0)

我没有在此屏幕截图中看到OmniSharp.log的完整输出,但是 我相信我在Visual Studio Code中运行应用程序有类似的问题。 问题与OmniSharp有关,OmniSharp正在主目录中寻找DNX运行时: $ HOME / .dnx / runtimes 。 但是,目前dnx运行时安装在 / usr / local / lib / dnx / runtimes 中。 如何解决它的可能性很小。我使用过最简单的一个: ln -sfF /usr/local/lib/dnx/runtimes ~/.dnx/

有关此问题的详细信息:https://github.com/Microsoft/vscode/issues/126

您还可以使用命令检查运行时的位置: dnvm list -detailed

我的输出看起来像这样(最后一列很重要):


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