如何在ubuntu中的visual studio代码中运行c#程序

时间:2023-01-16 15:38:56

I've got a problem with Visual Studio Code in Ubuntu 15.04. When I try to run c# program in Visual Studio Code I get an error "OmniSharp server is not running". How to fix that? I try to run a program by ctrl+shift+p through dnx: Run Command, but I can't. Maybe do I need install something for that?

我在Ubuntu 15.04中遇到了Visual Studio Code的问题。当我尝试在Visual Studio代码中运行c#程序时,出现错误“OmniSharp服务器未运行”。如何解决?我尝试通过ctrl + shift + p通过dnx运行程序:运行命令,但我不能。也许我需要为此安装一些东西?

2 个解决方案

#1


0  

The answer to your problem might be in the OmniSharpServer git page (https://github.com/nosami/OmniSharpServer). You have mono on your system, so you have to clone the OmniSharpServerRepository and execute this lines in a shell:

您的问题的答案可能在OmniSharpServer git页面(https://github.com/nosami/OmniSharpServer)。您的系统上有单声道,因此您必须克隆OmniSharpServerRepository并在shell中执行以下行:

git clone https://github.com/nosami/OmniSharpServer.git cd OmniSharpServer git submodule update --init --recursive xbuild If xbuild complained about some assemblies missing something is wrong with the git submodule update --init --recursive. As long as you get the "N Error(s)" message at the bottom you wont find any binary (exe or dll) in the project. If you solve the errors the binaries should be at "OmniSharpServer/OmniSharp/bin/Debug".

git clone https://github.com/nosami/OmniSharpServer.git cd OmniSharpServer git submodule update --init --recursive xbuild如果xbuild抱怨某些程序集缺失了git子模块更新错误--init --recursive。只要你在底部得到“N Error(s)”消息,你就不会在项目中找到任何二进制文件(exe或dll)。如果您解决了错误,二进制文件应位于“OmniSharpServer / OmniSharp / bin / Debug”。

A detailed error log would help or a bit more info.

详细的错误日志可以提供帮助,也可以提供更多信息。

#2


-1  

I downloaded VSCode + the C# Extension and then installed the .NET SDK from Microsoft's website: https://www.microsoft.com/net/learn/get-started/linuxubuntu

我下载了VSCode + C#Extension,然后从微软的网站上安装了.NET SDK:https://www.microsoft.com/net/learn/get-started/linuxubuntu

After I ran my first C# Application I got the prompt listed below on VSCode's Terminal and it worked like a charm! Hope it helps.

运行我的第一个C#应用程序后,我在VSCode的终端上得到了下面列出的提示,它就像一个魅力!希望能帮助到你。

Updating C# dependencies... Platform: linux, x86_64, name=ubuntu, version=16.04

更新C#依赖项...平台:linux,x86_64,name = ubuntu,version = 16.04

Downloading package 'OmniSharp for Linux (x64)' (23531 KB) .................... Done! Downloading package '.NET Core Debugger (linux / x64)' (54878 KB) .................... Done!

下载软件包'OmniSharp for Linux(x64)'(23531 KB)....................完成!下载软件包'.NET Core Debugger(linux / x64)'(54878 KB)....................完成!

Installing package 'OmniSharp for Linux (x64)' Installing package '.NET Core Debugger (linux / x64)'

安装包'OmniSharp for Linux(x64)'安装包'.NET Core Debugger(linux / x64)'

Finished

#1


0  

The answer to your problem might be in the OmniSharpServer git page (https://github.com/nosami/OmniSharpServer). You have mono on your system, so you have to clone the OmniSharpServerRepository and execute this lines in a shell:

您的问题的答案可能在OmniSharpServer git页面(https://github.com/nosami/OmniSharpServer)。您的系统上有单声道,因此您必须克隆OmniSharpServerRepository并在shell中执行以下行:

git clone https://github.com/nosami/OmniSharpServer.git cd OmniSharpServer git submodule update --init --recursive xbuild If xbuild complained about some assemblies missing something is wrong with the git submodule update --init --recursive. As long as you get the "N Error(s)" message at the bottom you wont find any binary (exe or dll) in the project. If you solve the errors the binaries should be at "OmniSharpServer/OmniSharp/bin/Debug".

git clone https://github.com/nosami/OmniSharpServer.git cd OmniSharpServer git submodule update --init --recursive xbuild如果xbuild抱怨某些程序集缺失了git子模块更新错误--init --recursive。只要你在底部得到“N Error(s)”消息,你就不会在项目中找到任何二进制文件(exe或dll)。如果您解决了错误,二进制文件应位于“OmniSharpServer / OmniSharp / bin / Debug”。

A detailed error log would help or a bit more info.

详细的错误日志可以提供帮助,也可以提供更多信息。

#2


-1  

I downloaded VSCode + the C# Extension and then installed the .NET SDK from Microsoft's website: https://www.microsoft.com/net/learn/get-started/linuxubuntu

我下载了VSCode + C#Extension,然后从微软的网站上安装了.NET SDK:https://www.microsoft.com/net/learn/get-started/linuxubuntu

After I ran my first C# Application I got the prompt listed below on VSCode's Terminal and it worked like a charm! Hope it helps.

运行我的第一个C#应用程序后,我在VSCode的终端上得到了下面列出的提示,它就像一个魅力!希望能帮助到你。

Updating C# dependencies... Platform: linux, x86_64, name=ubuntu, version=16.04

更新C#依赖项...平台:linux,x86_64,name = ubuntu,version = 16.04

Downloading package 'OmniSharp for Linux (x64)' (23531 KB) .................... Done! Downloading package '.NET Core Debugger (linux / x64)' (54878 KB) .................... Done!

下载软件包'OmniSharp for Linux(x64)'(23531 KB)....................完成!下载软件包'.NET Core Debugger(linux / x64)'(54878 KB)....................完成!

Installing package 'OmniSharp for Linux (x64)' Installing package '.NET Core Debugger (linux / x64)'

安装包'OmniSharp for Linux(x64)'安装包'.NET Core Debugger(linux / x64)'

Finished