I needed to IL merge the WP7Contrib assemblies today and this was the first time I've need used the tool. So I wanted to document configuration required for WP7.
Most of the information I found in the following posts, here & here, but neither specify the '/targetplatform' option for the WP7 platform which is the key piece of info.
So for 32 bit you need:
/targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone"
And for 64 bit you need:
/targetplatform:v4,"%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone"
So putting what I read together I was able to create the following:
"%programfiles%\microsoft\ilmerge\ilmerge.exe" /targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone" /out:WP7Contrib.dll ..\..\ILMergeAssemblyInfo.dll WP7Contrib.Caching.dll WP7Contrib.Collections.dll WP7Contrib.Common.dll WP7Contrib.Communications.dll WP7Contrib.Diagnostics.dll WP7Contrib.Logging.dll WP7Contrib.Messaging.dll WP7Contrib.Services.dll WP7Contrib.View.Controls.dll WP7Contrib.View.Transitions.dll
One thing to note about the tool is the output assembly information is taken from the first assembly in the list, so in this case this is 'ILMergeAssemblyInfo.dll'. I Created a separate assembly for this because I wanted specific attributes to be included into the assembly info, specifically I wanted to add the 'InternalsVisibleTo' attribute.
That pretty much covers it...
Comments
Post a Comment