I am trying to merge several assemblies into one as my Proxy assembly for WCF service. Currently, proxy users need to reference the assembly containing the data contracts as well as my domain assembly due to my inheritance schemes.
I would like to use ILMerge for this. In particular, the ILMerge-Tasks project looks promising, especially this line from the project home:
ILMerge-Tasks Home Project:
... It even includes a post-build event that combines ILMerge and task DLLs so that you can use the task without the presence of ILMerge.exe.
This is exactly what I would like to accomplish, but I really don't know how to do it. Please, help!
Other relevant (possibly) information:
- We use automatic builds in TFS, so the absence of ilmerge.exe will be a big plus.
Update:
So, I included ILMerge.MSBUild.Tasks.dll in my project and added the following to my build file (taken from the ilmerge project home):
<Target Name="AfterBuild">
<UsingTask TaskName="ILMerge.MSBuild.Tasks.ILMerge"
AssemblyFile="ILMerge.MSBuild.Tasks.ILMerge"/>
<ItemGroup>
<MergeAsm Include="BarProject.dll" />
<MergeAsm Include="FooProject.dll" />
</ItemGroup>
<ILMerge InputAssemblies="@(MergeAsm)" OutputFile="FooBar.dll" />
</Target>
But now I get the following error:
Task "UseTask" not found. Check the following: 1.) The name of the task in the project file matches the name of the task class. 2.) The task class is "publicly available" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared in the project file or in * .tasks files located in the "C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319" directory.
source
share