We made a command line tool which takes parameters and sends e-mails. We wanted to distribute this as an .exe but couldn't because it referenced a .dll. This meant that we had to send along the .dll and that it had to be in the same directory as the .exe. We wanted a way to have just one .exe but Visual Studio .NET doesn't offer this (a linker). Luckily, at the Microsoft Research Download Page there is a free tool called ILMerge which does just this. This is how you use it:
- download ILMerge
- put "
ILMerge.exe" in your \WINNT directory
- In VS.NET, right click project, Properties, Common Properties, Build Events
- In "Post-build Event Command Line" enter:
ilmerge /out:$(TargetDir)YOURAPPNAME.exe $(TargetPath) $(TargetDir)YOURDLLNAME.dll
- Then compile the Release version (not the debug version).
- In your "
bin\Release" directory, you will find a
YOURAPPNAME.exewhich can be run on its own without the .dll.