2010-11-18 80 views
1

我正在尝试使用SL 4类库(无xaml)来获得ILMerge。ILMerge for Silverlight 4

我有一个后生成任务:

<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) 

任何人有这样的运气?

感谢。

回答

2

切换到使用snk而不是pfx修复了问题。奇怪....感谢M Barnett!