我正在尝试让 ILMerge 使用 SL 4 类库(无 xaml)。
我有一个后期构建任务:
<Target Name="AfterBuild">
<CreateItem Condition="'%(Extension)'=='.dll'" Include="@(ReferenceCopyLocalPaths)">
<Output TaskParameter="Include" ItemName="IlmergeAssemblies" />
</CreateItem>
<Exec Command=""$..\..\..\References\Ilmerge.exe" /ndebug /targetplatform:v4,"C:\Program Files (x86)\Microsoft Silverlight\4.0.50917.0" /internalize:"$..\..\ILMergeInclude.txt" /keyfile:"$..\..\..\References\StrongName.pfx" /out:"@(MainAssembly)" "@(IntermediateAssembly)" @(IlmergeAssemblies->'"%(FullPath)"', ' ')" />
<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)
有人对此有任何运气吗?
谢谢。