开发者

ILMerge for Silverlight 4

开发者 https://www.devze.com 2023-01-25 23:42 出处:网络
I\'m trying to get ILMerge working with a SL 4 class library (no xaml). I have a post build task: <Target Name=\"AfterBuild\">

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;@(IntermediateAssemb开发者_开发技巧ly)&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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消