VS工程的“多dll与exe文件合并”

运行环境

ILMerge插件

1、打开 VS的"工具 - NuGet包管理器 - 管理解决方案的NuGet程序包"
2、在浏览中搜索"ILMerge",在官方源中,3.0.41版本的插件已不支持使用了
3、下拉列表其他版本可以安装,使用3.0.40
4、下载封装好的"ILMerge"任务插件"MSBuild.ILMerge.Task"
5、工程中添加图示3个文件
6、重新生成工程后,只剩余一个dll文件

其他dll文件均被封装

7、取消ILMerge插件后,正常生成多个dll

ILRepack插件

1、安装插件

ILRepack

ILRepack.Lib.MSBuild.Task

2、编写脚本
复制代码
#用于获取下一条语句中的dll名称
dir /b *.dll*>test.txt    
#执行合并指令
..\..\..\packages\ILRepack.2.0.18\tools\ILRepack /out:MergeDll.dll MergeDll.dll Microsoft.Bcl.AsyncInterfaces.dll Newtonsoft.Json.dll System.Buffers.dll System.Memory.dll System.Numerics.Vectors.dll System.Runtime.CompilerServices.Unsafe.dll System.Text.Encodings.Web.dll System.Text.Json.dll System.Threading.Tasks.Extensions.dll System.ValueTuple.dll
#暂停,查看合并信息
pause
相关推荐
水饺编程5 小时前
第5章,[Win32 章节] :圆角矩形教学插图绘制程序
c语言·c++·windows·visual studio
沧海一笑-dj1 天前
【C++】Visual Studio 2026下载和安装
c++·visual studio·vs·vs2026
一直C2 天前
Linux网络编程|HTTP协议详解(报文、请求方法、状态码)
linux·http·wireshark·vim·visual studio
水饺编程2 天前
第5章,[Win32 章节] :练习程序,BigFontPic
c语言·c++·windows·visual studio
Lhan.zzZ3 天前
QML 组件库:VS2022 + Qt 静态库方案
开发语言·c++·qt·visual studio
一直C3 天前
Linux应用软件编程|TCP协议与Socket全套编程(三次握手、四次挥手、报文头部、核心机制)
linux·网络协议·tcp/ip·wireshark·vim·visual studio
水饺编程7 天前
第5章,[Win32 章节] :Polygon 函数和多边形填充模式
c语言·c++·windows·visual studio
水饺编程8 天前
第5章,[Win32 章节] :绘图模式
c语言·c++·windows·visual studio
典典分享指南8 天前
Windows 自动化踩坑实录
python·intellij-idea·pyqt·emacs·visual studio
水饺编程8 天前
第5章,[Win32 章节] :绘制填充区域
c语言·c++·windows·visual studio