【发布时间】:2018-10-16 19:37:06
【问题描述】:
在编译我的项目时,我为每个命名空间创建一个 DLL 文件,并将它们包含到我将要构建的 EXE 中。我的问题是此操作会创建多个文件,并且输出似乎不可移植。
是否可以(以及如何)将所有 DLL 文件包含到单个 EXE 文件中?
这是我目前用来构建项目的构建脚本:
#!/bin/sh
if [ -d out ]; then
rm -rf out/
fi;
mkdir out/
csc /nologo /target:library /out:out/StateMachine.Models.dll \
StateMachine/Models/*.cs &&
csc /nologo /target:library /out:out/StateMachine.Builders.dll \
/reference:out/StateMachine.Models.dll \
StateMachine/Builders/*.cs &&
csc /nologo /target:exe /out:out/state-machine.exe \
/reference:out/StateMachine.Models.dll \
/reference:out/StateMachine.Builders.dll \
StateMachine/Application.cs
我正在使用这个脚本,因为我的机器无法安装/运行 MSVS IDE。
【问题讨论】:
-
使用 ILMerge.exe,如果它们都不是签名程序集。
-
感谢您让我了解 ILMerge。由于我无法使用 ILMerge,因此我快速搜索了一下并找到了替代方法:ILRepack
标签: c# compilation