ILMerge for Silverlight 4

≯℡__Kan透↙ 提交于 2019-12-11 13:26:38

问题


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="&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>

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.


回答1:


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



来源:https://stackoverflow.com/questions/4217010/ilmerge-for-silverlight-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!