ILMerge合并多个 DLL,简化发布

最近在用 .net 写一个小工具,依赖了部分第三方库,如下截图为 Release 目录,其中可执行程序为 mssql-tool-console.exe,在这么多文件中找到此执行程序需要有点麻烦,如果能把绝大多数的DLL文件合并为一个DLL文件,则找到exe可执行程序就很方便了。

经过调研,找到了ILMerge这个工具,特在此记录其使用方法。

  1. 下载 ILMerge 并安装
    下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=17630
    下载后安装即可,我是按照默认配置逐步安装的,安装目录为:C:\Program Files (x86)\Microsoft\ILMerge

https://github.com/Microsoft/ILMerge
https://www.microsoft.com/en-us/research/people/mbarnett/?
from=http%3A%2F%2Fresearch.microsoft.com%2Fen-us%2Fpeople%2Fmbarnett%2Fchangehistory.aspx
https://stackoverflow.com/questions/2961357/using-ilmerge-with-net-4-libraries
(方法用问题)http://stevemichelotti.com/ilmerge-unresolved-assembly-reference-not-allowed-system/
http://www.hurryupandwait.io/blog/what-you-should-know-about-running-ilmerge-on-net-4-5-assemblies-targeting-net-4-0

https://github.com/Fody/Costura

猜你喜欢

转载自www.cnblogs.com/junejs/p/12687086.html