using ILMerge with .NET 4 libraries

There was a very recent release to solve x64 problems. Get in touch with Mike Barnett directly if you still have problems (mbarnett at microsoft dot com) Addendum. There’s something very, very wrong about your /lib:”C:\Windows\Microsoft.NET\Framework64\v4.0.30319″ option. This has been getting lots of programmers in trouble lately, after .NET 4.5 was released. That directory is … Read more

How to Integrate ILMerge into Visual Studio Build Process to Merge Assemblies?

The “MSBuild ILMerge task” (or MSBuild.ILMerge.Task) NuGet package makes this process quite simple. It defaults to merging any “copy local” references into your main assembly. Note: Although the packages have similar names, this one is different from ILMerge.MSBuild.Tasks that Davide Icardi mentioned in his answer. The one I’m suggesting here was first published in August … Read more

ILMerge Best Practices

I use ILMerge for almost all of my different applications. I have it integrated right into the release build process so what I end up with is one exe per application with no extra dll’s. You can’t ILMerge any C++ assemblies that have native code. You also can’t ILMerge any assemblies that contain XAML for … Read more

Merging dlls into a single .exe with wpf

http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application This worked like a charm for me 🙂 and its completely free. Adding code in case the blog ever disappears. 1) Add this to your .csproj file: <Target Name=”AfterResolveReferences”> <ItemGroup> <EmbeddedResource Include=”@(ReferenceCopyLocalPaths)” Condition=”‘%(ReferenceCopyLocalPaths.Extension)’ == ‘.dll'”> <LogicalName>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</LogicalName> </EmbeddedResource> </ItemGroup> </Target> 2) Make your Main Program.cs look like this: [STAThreadAttribute] public static void Main() { AppDomain.CurrentDomain.AssemblyResolve … Read more

Merge DLL into EXE?

For .NET Framework 4.5 ILMerge.exe /target:winexe /targetplatform:”v4,C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0″ /out:finish.exe insert1.exe insert2.dll ILMerge Open CMD and cd to your directory. Let’s say: cd C:\test Insert the above code. /out:finish.exe replace finish.exe with any filename you want. Behind the /out:finish.exe you have to give the files you want to be combined.