将多个DLL合并为一个DLL问题 [英] Merge multiple DLL into one DLL issues

查看:143
本文介绍了将多个DLL合并为一个DLL问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家早安

我尝试使用ILMerge(2.12 exe可执行文件)在单个DLL中合并多个(不是我自己构建的)dll.

我使用Windows窗体项目测试了DLL,并注意到该过程称为"P".异常执行:精确地某些变量未初始化.

但是,如果我尝试运行相同的格式,则链接不统一的dll,并始终调用过程"P".我发现没有异常,程序正常运行.

我已经在这里想知道为什么???

我注意到ILMerge具有较新的版本(2.14),但由NuGet软件包运行.我从未使用过这些软件包NuGet,请问您是否有使用ILMerge NuGet的详细教程,并且达到了在单个DLL中加入多个DLL的目标.

感谢您的关注

问候

Matteo

Goodmorning everyone

I tried using ILMerge (2.12 exe executable) to merge multiple dll (built by me and not) in a single DLL.

I tested the DLL using a windows form project and noted that the procedure called "P" is executed in abnormally: precisely certain variables are not initialized.

If I try to run the same form, however, linking the dlls not united and always calling the procedure "P" I find that there aren't anomalies and the program runs correctly.

Already here I wonder why ???

I noticed that ILMerge has a newer version (2.14) but run by NuGet packages. I have never used these packages NuGet and I kindly ask you if you have a detailed tutorial for use ILMerge NuGet and reach my goal of joining multiple DLLs in a single DLL.

Thanks for the attention

Greetings

Matteo

推荐答案

"我使用Windows窗体项目测试了DLL,并注意到名为"P"的过程会在Windows上运行.错误地执行:精确地某些变量未初始化."

"I tested the DLL using a windows form project and noted that the procedure called "P" is executed in abnormally: precisely certain variables are not initialized."

这些是什么样的变量?静态字段,实例字段,局部变量?

What kind of variables are those? Static fields, instance fields, local variables?

无论如何,实际上并不能保证ILMerge与所有类型的代码/dll都能正常工作,而您试图包括尚未构建的dll的事实也无济于事.例如,反射代码对程序集包含的内容进行假设 某种类型可能会停止工作,因为合并后该程序集不再存在.

Anyway, there's really no guarantee that ILMerge works fine with all kind of code/dlls and the fact that you're trying to include dlls that haven't been built by you doesn't help. For example, reflection code that makes assumptions about what assembly contains a certain type may stop working because that assembly no longer exists after merge.

"我注意到ILMerge具有较新的版本(2.14),但由NuGet软件包运行.我从未使用过这些软件包NuGet,请问您是否有使用ILMerge NuGet的详细教程,并且达到了将多个DLL合并到单个DLL中的目标."

"I noticed that ILMerge has a newer version (2.14) but run by NuGet packages. I have never used these packages NuGet and I kindly ask you if you have a detailed tutorial for use ILMerge NuGet and reach my goal of joining multiple DLLs in a single DLL."

在这种情况下,您实际上不需要了解太多.只需使用zip工具(例如7-Zip)打开NuGet包,然后提取ILMerge.exe文件即可.就像非ILMerge版本一样使用它.

In this particular case you don't really need to know much. Just open the NuGet package with a zip tool (7-Zip for example) and extract the ILMerge.exe file. Use that just like the non-package version of ILMerge.


这篇关于将多个DLL合并为一个DLL问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆