【发布时间】:2015-11-23 17:09:22
【问题描述】:
我在 Ubuntu 15.04 中遇到了 Visual Studio Code 的问题。当我尝试在 Visual Studio Code 中运行 c# 程序时,出现错误“OmniSharp 服务器未运行”。如何解决?我尝试通过 dnx: Run Command 通过 ctrl+shift+p 运行程序,但我不能。也许我需要为此安装一些东西?
【问题讨论】:
标签: c# ubuntu visual-studio-code
我在 Ubuntu 15.04 中遇到了 Visual Studio Code 的问题。当我尝试在 Visual Studio Code 中运行 c# 程序时,出现错误“OmniSharp 服务器未运行”。如何解决?我尝试通过 dnx: Run Command 通过 ctrl+shift+p 运行程序,但我不能。也许我需要为此安装一些东西?
【问题讨论】:
标签: c# ubuntu visual-studio-code
您的问题的答案可能在 OmniSharpServer git 页面 (https://github.com/nosami/OmniSharpServer) 中。您的系统上有单声道,因此您必须克隆 OmniSharpServerRepository 并在 shell 中执行以下行:
git 克隆https://github.com/nosami/OmniSharpServer.git cd OmniSharpServer git 子模块更新 --init --recursive xbuild 如果 xbuild 抱怨某些程序集丢失了 git submodule update --init --recursive 有问题。只要您在底部收到“N Error(s)”消息,您就不会在项目中找到任何二进制文件(exe 或 dll)。如果您解决了错误,则二进制文件应位于“OmniSharpServer/OmniSharp/bin/Debug”。
详细的错误日志会有所帮助或提供更多信息。
【讨论】:
我下载了 VSCode + C# 扩展,然后从微软网站上安装了 .NET SDK:https://www.microsoft.com/net/learn/get-started/linuxubuntu
在我运行我的第一个 C# 应用程序后,我在 VSCode 的终端上得到了下面列出的提示,它就像一个魅力!希望对您有所帮助。
正在更新 C# 依赖项... 平台:linux,x86_64,名称=ubuntu,版本=16.04
下载包“OmniSharp for Linux (x64)”(23531 KB) ....................完成! 下载包'.NET Core Debugger (linux / x64)' (54878 KB) ....................完成!
安装包“OmniSharp for Linux (x64)” 安装包'.NET Core Debugger (linux / x64)'
完成
【讨论】: