I'm using ILMerge via an in-line script in my Post-Build event, in order to merge Satellite dll's and preserve all available cultures in single dlls
"C:\Program Files (x86)\Microsoft\ILMerge\ilmerge.exe" /t:library /wildcards /targetplatform:"v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319" /lib:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" "$(OutDir)en-us\Satellite.dll" "$(ProjectDir)bin\$(ConfigurationName)\$(TargetFileName)" /out:"$(OutDir)Merged\$(TargetFileName)"
Initially, I ran into issues merging multiple Satellite Dlls with the same name (like en-us\Satellite.dll and fr\Satellite.dll) in a single ILMerge command, but thanks to help here: Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) - possible?
I have found this is only an error with ILMerge, and can be circumvented by merging each Satellite DLL in a seperate merge statement.
Moving forward, you can imagine that there are currently 38 available cultures and languages in my base DLL, and managing these via 38 copies of that line of command line is overkill. On top of that, I have multiple build paths, which merge upwards into platform-specific Device Dll's, which means I have to do the same in at least 3 more places. 152 copies of that single command line (all in that tiny Post-Build popup window).
I understand looking at this page: http://ift.tt/1MKAkAu that I can create an xml configuration file for my merges and it would look something like this:
<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
</startup>
</configuration>
but I'm not sure how to implement it. I assume I can move ALL of the configuration parameters (like target and wildcard, lib and paths) to the ILMerge.config file and I hope I'm not wrong, though according to this page you would add it to the .csproj file: http://ift.tt/1UkYPWZ
I'd like to know: What is the command line for referencing an ILMerge.config.xml settings file in the PostBuild command?
Is the 'configuration' element enumerable? (ie, can I define multiple merges in the same config file?)
Does the config file support conditions, like Condition="'$(Configuration)' == 'Release'"?
Thanks in advance!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire