I’ve been working on my VisioAutomation project for years now - it appeared on CodePlex in 2009 if I recall correctly but existed for a few years before that. In any case, as the library has grown, one thing I was never satisfied with was the number of DLLs that needed to be included to take advantage of the library completely. I really wanted one DLL that took care of everything.
For example, let’s look at my PowerShell module for Visio 2010 - called VisioPS (you can download VisioPS here). Below is what bin/Debug looked like a few days ago.
In Yellow are all the DLLs my VisioAutomation requires to work. The Green ones are “helper” DLLs – for those 3rd party DLLs.
In Yellow are all the DLLs my VisioAutomation requires to work.
The Green ones are “helper” DLLs – for those 3rd party DLLs.
I wanted this to be much simpler. Thanks to ILMERGE. It has gotten much better. Below you see a big reduction in the number of DLLs.
ILMERGE helped me get rid of all the Yellow items. Then I incorporated the Green items into VisioAutomation.DLL.
For reference here is the exact MSBUILT task I am using to perform the merging of the assemblies.
<Target Name="AfterBuild"> < CreateItem Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)'=='.dll'"> <Output ItemName="AssembliesToMerge" TaskParameter="Include" /> </CreateItem> <Exec Command=""C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" /out:@(MainAssembly) /targetplatform:v4,$(MSBuildToolsPath) "@(IntermediateAssembly)" @(AssembliesToMerge->'"%(FullPath)"', ' ')" /> <Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" /> < /Target>
NOTES: