有时候要发布的软件会包含多个程序集,如果能把多个程序集合成一个有时会比较方便使用。

ILMerge.exe就是用于将多个程序集合并的工具。

官法下载地址: http://www.microsoft.com/en-us/download/details.aspx?id=17630

安装后可在命令提示符中使用。

命令内容:

Usage: ilmerge [/lib:directory]* [/log[:filename]] [/keyfile:filename [/delaysign]] [/internalize[:filename]] [/t[arget]:(library|exe|winexe)] [/closed] [/ndebug] [/ver:version] [/copyattrs [/allowMultiple] [/keepFirst]] [/xmldocs] [/attr:filename]

[/targetplatform:<version>[,<platformdir>] | /v1 | /v1.1 | /v2 | /v4] [/useFullPublicKeyForReferences]

[/wildcards] [/zeroPeKind] [/allowDup:type]* [/union] [/align:n]

/out:filename <primary assembly> [<other assemblies>...]

 

其中这两个是必须的参数:/out:filename <primary assembly>

out:filename 表示输出的程序集名,<primary assembly>表示输入的主程序集名。下面是一个实例:

ilmerge.exe /t:winexe /targetplatform:v2 /out:Jihua.cnblogs.com.new.exe jihua.cnblogs.com.exe Interop.IWshRuntimeLibrary.dll

表示将主程序集jihua.cnblogs.com.exe和另一个程序集Interop.IWshRuntimeLibrary.dll合并为Jihua.cnblogs.com.new.exe,/t:winexe表示生成目标是Windows应用程序,/targetplatform:v2表示生成目标是.net 2.0程序集。

posted on 2012-09-25 00:52  计划  阅读(2372)  评论(0编辑  收藏  举报