适用于 Silverlight 4 的 ILMerge
我正在尝试让 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)
有人对此有运气吗?
谢谢。
I'm trying to get ILMerge working with a SL 4 class library (no xaml).
I have a post build task:
<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>
At first I got an error about an unresolved assembly reference to System.Core, but I read about having to add the /targetPlatform
switch. That got rid of that error, but now with the task above, I get:
An exception occurred during merging:
Unable to load DLL 'mscorsn.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Anyone have any luck with this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
改用 snk 而不是 pfx 解决了这个问题。奇怪的......谢谢M Barnett!
Switching to use an snk instead of a pfx fixed the problem. Bizarre.... Thanks M Barnett!