ILMerge for Silverlight 4
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)" "@(IntermediateAssemb开发者_开发技巧ly)" @(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.
Switching to use an snk instead of a pfx fixed the problem. Bizarre.... Thanks M Barnett!
精彩评论