我试图让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)
有人在这方面运气好吗?
谢谢。