This article is a mirror article of machine translation, please click here to jump to the original article.

View: 5500|Reply: 2

[Source] VS merges .NET Framework (dll) assemblies using ILmerge

[Copy link]
Posted on 2023-5-14 21:24:55 | | | |
Requirements: The .NET Framework project references a number of dll assemblies that package dll assemblies directly into exes, which this article uses ILMerge to combine multiple collections of programs into a single assembly.

GitHub address:The hyperlink login is visible.

First, VS 2022 creates a new .NET Framework 4.5 console project, tests reference the Newtonsoft.Json package, and the code is as follows:

You can see that many files are generated at the end as shown below:



To reference the ILMerge related package, it is as follows:

At the same time, the project will generate two files, "ILMerge.props" and "ILMergeOrder.txt", please refer to the official documentation for specific functions.

Right-click to regenerate the project, and you can see that the dll has been merged into the exe program, and the program can run normally, as shown in the figure below:



Of course, it is also possible to merge assemblies directly by executing ILMerge.exe commands, such as:


(End)





Previous:【Turn】100-person R&D team 10 billion sales scale technical architecture practice sharing
Next:Recap: RabbitMQ creates custom switches and queues
 Landlord| Posted on 2023-5-14 21:25:20 |
.net/c# Use Costura.Fody to package the DLL into the EXE
https://www.itsvse.com/thread-4677-1-1.html
Posted on 2023-5-15 11:01:57 |
Thank you for sharing, learn from it.
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com