Sonic provides their own DLLs that were ported from Java for .NET developers. There are 7 DLLs you have to reference in order to communicate with Sonic. Here’s how this can be done using ILMerge by simply modifying the project file using an after build target.
The following below does a few things.
It takes all of the assemblies that are outputted to the build directory and passes that to the ILMerge command.
Once they are merged the files are deleted.
<Target Name="AfterBuild">
<CreateItem Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)'=='.dll'">
<Output TaskParameter="Include" ItemName="IlmergeAssemblies" />
</CreateItem></Target>
<Exec Command="&quot;$(MSBuildProjectPath)..\..\ThirdPartyAssemblies\Ilmerge\Ilmerge.exe&quot; /allowDup /log /keyfile:$(AssemblyOriginatorKeyFile) /out:@(MainAssembly) &quot;@(IntermediateAssembly)&quot; @(IlmergeAssemblies->'"%(FullPath)"', ' ')" />
<Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
Read more: Words of Wisdom From The Elder