且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C# 程序在 Linux 的单声道下无法运行.

更新时间:2023-10-20 23:49:10

正如我在评论中所说,如果你想生成一个自给自足的 Linux 可执行二进制文件,你不应该使用 mkbundle 在 Windows 上.您应该在 Linux 上运行 mkbundle 以获得 Linux 可执行文件(您可能应该关心 32 位的 Linux-X86 和 64 位的 Linux-x86-64,它们是不同).

As I said in a comment, if you want to produce a self-sufficient Linux executable binary, you should not use mkbundle on Windows. You should run mkbundle on Linux to get a Linux executable (and you probably should care about Linux-X86 in 32 bits and Linux-x86-64 in 64 bits, which are different).

我建议您在 Linux 机器中编译和运行您的应用程序(如果需要,您甚至可以在 VM 中安装 Linux 系统).因此,最简单的方法是在您的计算机上安装 Linux 发行版(例如 Debian).

I suggest you to compile and run your application in a Linux box (you could even install a Linux system inside a VM if you want). So the simplest way is to install a Linux distribution (e.g. Debian) on your machine.

我认为您不会轻易找到能够在 Windows 机器上编译针对 Linux 的 Mono 程序的交叉编译器.

I don't think you'll easily find a cross-compiler able to compile, on a Windows box, a Mono program targeted for Linux.

而您正在做的事情(在 Windows 上运行 mkbundle)正在生成一个 Windows 可执行文件(用于 Cygwin),它无法为您提供 Linux 二进制可执行文件,无论您尝试什么选项.

And what you are doing (running mkbundle on Windows) is producing a Windows executable (for Cygwin), it cannot give you a Linux binary executable, whatever option you try.