我正在尝试一些探索性的事情:
假设我有一个库“coolproject”,它依赖于one.dll
, two.dll
, and three.dll
.
我想使用ILMerge将coolproject与one.dll
and two.dll
但不是three.dll
。合并完成后我应该coolproject.dll
and three.dll
。无论我打算在哪里使用coolproject.dll
我也必须参考three.dll
这可能吗?每当我尝试时,我都会得到。Unresolved assembly reference not allowed: three
。我省略了three.dll
通过设置“复制本地”= false。
[EDIT]:
执行如下:
ILMerge /targetplatform:v2 /log /internalize /out:bin\coolproject.dll obj\Debug\coolproject.dll C:\Users\Nick\Projects\test\bin\one.dll C:\Users\Nick\Projects\test\bin\two.dll
这不起作用的原因非常简单:ILMerge 必须能够找到您从列表中省略的 dll。
在评估目标库中的依赖项时,ILMerge 默认情况下会检查各个位置以识别依赖库(\bin、GAC 等),即使您从命令行列表中省略了它。如果找不到该库,您必须使用\lib
转变。否则你会看到Unresolved assembly reference not allowed: three
error.
Example:
ILMerge /lib:..\three\bin\three.dll /targetplatform:v2 /log /internalize /out:bin\coolproject.dll obj\Debug\coolproject.dll C:\Users\Nick\Projects\test\bin\one.dll C:\Users\Nick\Projects\test\bin\two.dll
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)