问题描述
在 .NET C# 工具的构建过程中,我一直在使用 ILMerge 将程序集合并为单个 exe.
In the build process for a .NET C# tool, I have been using ILMerge to merge the assemblies into a single exe.
我最近添加了一个新的类库,现在 ILMerge 失败了.我记得告诉它合并到新的 DLL 中!
I added a new class library recently, and now the ILMerge is failing. I have remembered to tell it to merge in the new DLL!
它现在给了我这个错误,我不太明白:
It is now giving me this error, which I don't really understand:
ILMerge.Merge:程序集'DataObjects' 未合并正确.它仍然被列为目标中的外部参考组装.
我使用项目"引用完成的所有程序集引用,过去都没有失败.
All of the assembly references I have done using 'project' references, and it has not failed in the past.
谁能为我解释这个错误,或者请提出解决方法?
Can anyone explain this error for me, or suggest a workaround please?
推荐答案
我不得不使用 /closed
参数.根据官方文档:
I had to use the /closed
argument. According to the official docs:
关闭
在调用 Merge 之前设置时,然后是传递闭包"计算并添加输入程序集到输入程序集列表.一个组装被认为是如果是传递闭包直接引用或引用间接地,从最初的一个指定的输入程序集,它有对其中之一的外部引用输入程序集,或其中之一具有此类引用的程序集.复杂,但这就是生活......
When this is set before calling Merge, then the "transitive closure" of the input assemblies is computed and added to the list of input assemblies. An assembly is considered part of the transitive closure if it is referenced, either directly or indirectly, from one of the originally specified input assemblies and it has an external reference to one of the input assemblies, or one of the assemblies that has such a reference. Complicated, but that is life...
这篇关于ILMerge DLL:程序集未正确合并,仍列为外部参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!