适用于 Silverlight 4 的 ILMerge

发布于 2024-10-03 04:18:43 字数 1237 浏览 3 评论 0原文

我正在尝试让 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)

有人对此有运气吗?

谢谢。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哑剧 2024-10-10 04:18:43

改用 snk 而不是 pfx 解决了这个问题。奇怪的......谢谢M Barnett!

Switching to use an snk instead of a pfx fixed the problem. Bizarre.... Thanks M Barnett!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文