ILMerge完全符合您的要求
该页面有点误导,ILMerge根据其实际网页在V3和V4程序集上工作
ILMerge应该适用于较新版本的.NET.只需使用选项:/ targetplatform:v4,.对于3.5版,您可能不需要设置目标平台,但您可能需要将v3.5框架目录添加为/ lib选项,以便可以找到其中的程序集.(除非他们在GAC中,否则无论如何都会找到它们.)要在v4.0运行时运行ILMerge,请使用此配置文件.
要回答如何在其他答案的问题中使用它
用法:ilmerge [/ lib:directory] [/ log [:filename]] [/ keyfile:filename [/ delaysign]] [/ internalize [:filename]] [/ t [arget] :(库| exe | winexe) ] [/ closed] [/ ndebug] [/ ver:version] [/ copyattrs [/ allowMultiple]] [/ xmldocs] [/ attr:filename] [/ ta rgetplatform:[,] |/v1 | /v1.1 |/v2 |/v4] [/ useFullPublicKeyForReferences] [/ wildcards] [/ zeroPe Kind] [/ allowDup:type]*[/ union] [/ align:n]/out:filename [...]
因此,ilmerge /out:Combined.exe mainFile.exe otherDll.dll对于您的情况,大多数默认值应该没问题