我在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:0 [ERROR] Error: Failed to start OmniSharp
我已经安装了最新版本的Mono(4.2.1)以及所有带有Mono程序集的子包,安装dnvm
并运行dnvm upgrade -r mono
,运行dnu restore
,但OmniSharp一次又一次失败,IntelliSence在VSCode中无法工作.
我该如何解决?
PS它不是ASP.NET,只是控制台C#项目.
您的版本可能已过期.在vs代码中卸载并重新安装C#扩展.
按F1,键入ext show installed
,按Enter.单击x
以将其删除.
重启vscode.
按F1,键入ext install
,按Enter.单击下载图标进行安装.
重启vscode.
Ominsharp现在将运行.