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
相关推荐
我不是懒洋洋2 天前
【C++】内存管理与模板(C++内存管理方式、new和delete的实现原理、malloc/free和new/delete的区别、函数模板、类模板)
c语言·开发语言·c++·青少年编程·visual studio
jingshaoqi_ccc2 天前
windows 10系统下QT的安装及在Visual studio中的扩展安装
windows·qt·visual studio
叶子野格2 天前
《C语言学习:文件操作》16
c语言·开发语言·c++·学习·visual studio
叶子野格3 天前
《C语言学习:位运算》17
c语言·开发语言·c++·学习·visual studio
我不是懒洋洋3 天前
手写一个异步日志库:从printf到高性能无锁日志
java·c语言·开发语言·c++·visual studio
海清河晏1116 天前
字符串匹配:BF算法与KMP算法
数据结构·算法·visual studio
Mister西泽8 天前
C++ Primer Plus 第六版 编程练习题及详细答案
开发语言·c++·学习·visual studio
weixin_428005308 天前
.vdproj项目加载提示不兼容问题处理
c#·visual studio·.vdproj·.vdproj不兼容
yngsqq9 天前
AutoCAD 2024 + Visual Studio 2022 ARX 二次开发从零到 Hello World 保姆级教程——001环境搭建
ide·visual studio
解道Jdon11 天前
从Go转向Rust迁移指南:靠自觉 vs. 靠编译器
ide·windows·git·svn·eclipse·github·visual studio