与ILMerge合并的DLL在clr4下工作,但在clr2下

时间:2015-05-19 14:43:29

标签: ilmerge

我正在使用以下参数运行ILMerge:

Executing 'C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe'
     [exec] '/keyfile:C:\myKey.snk'
     [exec] '/target:library'
     [exec] '/targetplatform:v2,C:\Windows\Microsoft.NET\Framework\v2.0.50727'
     [exec] '/copyattrs'
     [exec] '/lib:C:\Windows\Microsoft.NET\Framework\v2.0.50727'
     [exec] '/log:log.txt'
     [exec] '/out:C:\mergedDll.dll'
     [exec] 'mydll1.dll'
     [exec] 'mydll2.dll'

再现的dll似乎适用于CLR4,但不适用于CLR2。当我用Corflags测试dll时,我得到以下输出:

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 9
ILONLY    : 1
32BIT     : 0
Signed    : 1

我用CLR2得到的错误是:

error BC30009: Reference required to assembly 'mergedDll, Version=1.2.3.123, Culture=neutral, PublicKeyToken=1234dbf1234567b' containing the implemented interface 'com.mycompany.myapplication.MyInterface'. Add one to your project.

上面提到的接口是用J#编写的。 如何使合并的dll在CLR2下工作?

谢谢!

0 个答案:

没有答案