c# - 在单个 exe 中捆绑 .net exe、dll、.net 环境和 native dll

标签 c# windows gcc

我正在尝试使用 mkbundle 将我的 C# 应用程序 (.exe) 与其依赖的 dll、 native dll 和所需的 .net 程序集捆绑到单个 exe。

那么,首先是否可以使用 mono mkbundle 来做到这一点?

如果是,当我尝试使用命令时

C:\MyProjDir>mkbundle -o BundleName --deps OriginalAppName.exe

编译时

as -o temp.o temp.s 

我得到错误:

'as' is not recognized as an internal or external command, operable program or batch file. [Fail]

我发现某个地方需要安装 gcc、gcc-mingw 和 as 包。 (原文如此)。我确实安装了 gcc、gcc-mingw,但我不知道在哪里可以找到包,这是错误的。 请建议是否有任何其他方法可以做到这一点。 谢谢

最佳答案

您可以使用 ILMerge

对于 native DLL,您可以将 DLL 作为应用程序资源嵌入,并在执行时将资源提取到磁盘。

关于c# - 在单个 exe 中捆绑 .net exe、dll、.net 环境和 native dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26166355/

相关文章:

c# - 锁定非静态方法

c# - 在c# 3.0 中,是否可以将隐式运算符添加到字符串类中?

windows - 强制用户使用 Windows 服务登录

c++ - 无法从源代码构建 GCC 10

c# - 通过 Azure 函数显示 Azure Blob 存储中的文件

c# - 具有可调整图 block 大小的 WinRT Gridview

node.js - 即使在 PATH 中也无法识别 Node

python - 指定主机时,FastAPI/uvicorn 不工作

c - ARM 程序集 : can’t find a register in class ‘GENERAL_REGS’ while reloading ‘asm’

c++ - 在 C++ 中构造左填充的 NULL 固定长度字符数组的最有效方法是什么?