I have a program in C sharp, can I compile it as an executable for Linux server so that I can run it on the server without installing mono?(我有一个 C 语言程序,我可以将它编译为 Linux 服务器的可执行文件,以便我可以在服务器上运行它而无需安装单声道?) - IT屋-程序员软件开
问题描述
可能重复:
如何使用 Mono 和 mkbundle 将简单的 .Net 控制台项目转换为可移植的 exe?
我有一个在 windows 上编写的 C# 程序,我需要将它传输到 linux 服务器.
但是客户不想在他的服务器上安装单声道,所以我想找到一种方法让他更容易.
是否可以将此程序转换为在没有安装单声道的情况下可以在 linux 上运行的格式?
I have a C# program which was written on windows, I need to transfer it to linux server.
However client doesn't want instal mono on his server, so I want to find a way to make it easy for him.
Is it possible to convert this program in such a format that it will run on linux without mono installed there?
推荐答案
你需要使用mkbundle如果您的目标系统没有安装单声道,请使用 --static
选项.
You need to use mkbundle with the --static
option if your target system does not have mono installed.
捆绑包还支持 --static 标志.--static 标志使 mkbundle 生成静态链接 Mono 运行时的静态可执行文件.请注意,此选项将触发 LGPL 要求,即您仍将独立部分分发给您的用户,以便他可以手动升级他的 Mono 运行时(如果他选择这样做)
Bundles in addition support a --static flag. The --static flag causes mkbundle to generate a static executable that statically links the Mono runtime. Be advised that this option will trigger the LGPL requirement that you still distribute the independent pieces to your user so he can manually upgrade his Mono runtime if he chooses to do so
这篇关于我有一个 C 语言程序,我可以将它编译为 Linux 服务器的可执行文件,以便我可以在服务器上运行它而无需安装单声道?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我有一个 C 语言程序,我可以将它编译为 Linux 服务器的可执行文件,以便我可以在服务器上运行它而无需安装单声道?


- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01