代码之家  ›  专栏  ›  技术社区  ›  Jeff

Silverlight 4的ILMerge

  •  1
  • Jeff  · 技术社区  · 14 年前

    我试图让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)
    

    有人在这方面运气好吗?

    谢谢。

    1 回复  |  直到 14 年前
        1
  •  2
  •   Jeff    14 年前

    切换到使用snk而不是pfx解决了这个问题。奇怪的。。。。谢谢巴内特!