【问题标题】:OmniSharp failed to start in Visual Studio CodeOmniSharp 无法在 Visual Studio Code 中启动
【发布时间】:2015-12-07 14:17:29
【问题描述】:

我在 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 程序集的子包,安装 dnvm 并运行 dnvm upgrade -r mono,运行 dnu restore,但 OmniSharp 一次又一次地失败并且 IntelliSence 无法正常工作VSCode。

我该如何解决?

附:它不是 ASP.NET,只是控制台 C# 项目。

【问题讨论】:

  • 我有类似的问题,但在 Linux (debian 8) 上。你能解决这个问题吗?
  • @Nanda,我不能。也许在(尚未)支持的 VSCode 非 ASP.NET 项目中,我不知道。

标签: c# mono visual-studio-code omnisharp


【解决方案1】:

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

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

Ominsharp 现在将运行。

【讨论】:

  • 这种最前沿的东西很酷,但有时很痛苦。感谢您提供简单的解决方案。它对我有用:)
  • 您的回答很有用,谢谢,但在我现在拥有的代码版本中,在第 1 步之后。出现一个列表,其中出现“c# for visual studio code powered by omnisharp”,点击可以更新。对不起我的英语不好
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-11-16
  • 2016-02-14
  • 2016-12-23
  • 1970-01-01
  • 2022-07-26
  • 2016-08-18
  • 1970-01-01
相关资源
最近更新 更多