3

我在 Kubuntu 15.04 下的 VSCode (v. 0.10.3) 中的 C# 上打开现有 MSBuild 项目(实际上来自 VS 2012)的文件夹。OmniSharp 启动后抛出错误:

[INFO] Starting OmniSharp at '/home/tezaurismosis/Development/NET/ConsoleApp/ConsoleApp.sln'...
[INFO] Started OmniSharp from '/home/tezaurismosis/VSCode/resources/app/extensions/csharp-o/bin/omnisharp' with process id 14956...
System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1':
    framework/System.Collections 
    framework/System.Collections.Concurrent 
    framework/System.Globalization 
    framework/System.IO 
    framework/System.Net.Http.WebRequest 
    framework/System.Reflection 
    framework/System.Runtime 
    framework/System.Text.Encoding 
    framework/System.Threading.Tasks 
Searched Locations:
... some paths ...
Try running 'dnu restore'.
at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) <0xb71f6a58 + 0x0035b> in <filename unknown>:0 
[ERROR] Error: Failed to start OmniSharp

我已经安装了最新版本的 Mono (4.2.1) 和所有带有 Mono 程序集的子包, install dnvmand run dnvm upgrade -r mono, run dnu restore,但是 OmniSharp 一次又一次地失败并且 IntelliSence 在 VSCode 中不起作用。

我该如何解决?

PS 这不是 ASP.NET,只是控制台 C# 项目。

4

1 回答 1

3

您的版本可能已过时。在 vs code 中卸载并重新安装 C# 扩展。

  1. F1,键入ext show installed,按Enter。单击x以将其删除。
  2. 重启vscode。
  3. F1,键入ext install,按Enter。单击下载图标进行安装。
  4. 重启vscode。

Ominsharp 现在将运行。

于 2016-03-16T17:57:17.267 回答