monodevelop无法执行项目

我已经安装了monodevelop并在C#console中编写了一个hello world程序但是在运行配置时我选择在外部控制台中运行复选框并单击运行按钮monodevelop说:无法执行“{Project Path}”

Os:Debian,Kali 2

编辑:和Console.ReadLine()在默认运行配置中不起作用。

屏幕商店添加了屏幕截图

我有同样的问题,这是我的解决方案。

操作系统:Linux Mint 18.1 Cinnamon 64-Bit

Monodevelop:6.1.2.44 flatpak安装

afaik MonoDevelop需要xterm或gnome-terminal才能在外部控制台中运行程序。 如果两者都丢失,则会出现“无法执行…”错误。

MonoDevelop日志显示: ~/.var/app/com.xamarin.MonoDevelop/cache/MonoDevelop-6.0/Logs/Ide.log

 ERROR [2017-01-10 19:47:49Z]: Cannot execute "/home/...exe" System.InvalidOperationException: Cannot start process because a file name has not been provided. 

在我的情况下,我必须安装xterm并将其复制并且它依赖于flatpak运行时:

 sudo apt-get install xterm cp -v /usr/bin/xterm ~/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/1.4/active/files/bin/ cp -v /usr/lib/x86_64-linux-gnu/libXaw* ~/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/1.4/active/files/lib/ cp -v /usr/lib/x86_64-linux-gnu/libXmu* ~/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/1.4/active/files/lib/ cp -v /usr/lib/x86_64-linux-gnu/libutempter* ~/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/1.4/active/files/lib/ cp -v /lib/x86_64-linux-gnu/libpng12* ~/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/1.4/active/files/lib/ cp -v /lib/x86_64-linux-gnu/libtinfo* ~/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/1.4/active/files/lib/ 

也许不是最好的解决方案,但它对我有用。

这是一个用于“复制xterm”方法的自动双线程(在Ubuntu 16.04上测试):

 ldd `which xterm` | awk '{if ($2 == \"=>\") print $3}' | grep / | xargs -I{} cp -Lnv {} .local/share/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.4/active/files/lib/ cp -nv `which xterm` .local/share/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.4/active/files/bin/ 

我发现了几种方法:

1.创建GTK 2.0项目,而不是创建控制台应用程序。 例如:

 using System; using Gtk; namespace Test { class MainClass { public static void Main(string[] args) { /*Application.Init(); MainWindow win = new MainWindow(); win.Show(); Application.Run(); */ Console.WriteLine("Hello World"); } } } 

Application Output pad ,您将看到“Hello World”。

  1. 安装mono-runtimesudo apt-get install mono-runtime )并转到bin/Debug/目录。 在那里你会找到一个.exe文件,你只需执行./{{NameOfProject}}.exe

我不得不在Linux Mint Sylvia中打开一个终端窗口,然后切换到Project的名称,然后从那里切换到bin / Debug文件夹。 我看到有一个由monoDevelop创建的exe。 我将exe的模式更改为可执行文件。 然后我通过输入它的name.exe运行exe,它工作。