ILMerge DLL:大会不正确合并,仍被列为一个外部参考 [英] ILMerge DLL: Assembly not merged in correctly, still listed as an external reference

查看:908
本文介绍了ILMerge DLL:大会不正确合并,仍被列为一个外部参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个.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:装配
数据对象在
不正确的合并。它仍然列为
目标
装配外部引用。

ILMerge.Merge: The assembly 'DataObjects' was not merged in correctly. It is still listed as an external reference in the target assembly.

所有程序集引用的我使用项目的引用都做了,现在也没有失败过。

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?

推荐答案

我不得不使用 /关闭参数。根据官方文档:

I had to use the /closed argument. According to the official docs:

关闭

在这之前调用设置合并,

输入组件的传递闭包被计算并添加
键输入组件的列表。一个
组件被认为是
传递闭包的一部分,如果它是
引用的,无论是直接或
间接从最初
中的一个指定的输入组件,它有
中的一个外部基准到
输入组件中的一个,或
组件具有这样的参考之一。
复杂,但这就是生活......

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:大会不正确合并,仍被列为一个外部参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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