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 服务器的可执行文件,以便我可以在服务器上运行它而无需安装单声道?


基础教程推荐
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01