1

我正在尝试让 ILMerge 使用 SL 4 类库(无 xaml)。

我有一个后期构建任务:

 <Target Name="AfterBuild">
    <CreateItem Condition="'%(Extension)'=='.dll'" Include="@(ReferenceCopyLocalPaths)">
      <Output TaskParameter="Include" ItemName="IlmergeAssemblies" />
    </CreateItem>
    <Exec Command="&quot;$..\..\..\References\Ilmerge.exe&quot; /ndebug /targetplatform:v4,&quot;C:\Program Files (x86)\Microsoft Silverlight\4.0.50917.0&quot; /internalize:&quot;$..\..\ILMergeInclude.txt&quot; /keyfile:&quot;$..\..\..\References\StrongName.pfx&quot; /out:&quot;@(MainAssembly)&quot; &quot;@(IntermediateAssembly)&quot; @(IlmergeAssemblies->'&quot;%(FullPath)&quot;', ' ')" />
    <Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
  </Target>

起初我收到一个关于 System.Core 的未解析程序集引用的错误,但我读到了必须添加/targetPlatform开关。那摆脱了那个错误,但现在有了上面的任务,我得到:

An exception occurred during merging:
  Unable to load DLL 'mscorsn.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

有人对此有任何运气吗?

谢谢。

4

1 回答 1

2

切换到使用 snk 而不是 pfx 解决了这个问题。奇怪....谢谢M Barnett!

于 2010-11-22T06:10:52.120 回答