tags:

views:

487

answers:

2

I am developing a .NET application which uses a few projects that I've pieced together from other internal projects. I was thinking about merging the .exe and the DLLS into a single executable file with a tool called ILMerge.

I may be sending the executable outside the company, so merging everything into a single file would be easier to pass out. But, I was wondering if there are any downsides to merging DLLs with the executable?

+4  A: 

As long as they're your libraries, I don't think there's any big problem with it. Unless it makes the image absolutely and monstrously huge, I think it's better if the executable relies on itself as much as it can (exceptions being, of course, when you're replicating system functionality... no point in that).

On the other hand, if the libraries don't actually belong to you, you had better make sure that their terms of use allow for this. You may not be allowed to package them up into your executable and distribute them as your own code (even if you give your product away and the library was "free", you may still have to acknowledge that you use it some how so make sure to check the terms of use for all the libraries you include).

Jason Coco
Thanks for pointing this out, I never thought about it until you mentioned it. There was some DLLs that we were using internally, but thought they were developed in-house. I was wrong.
Richard R
A: 

Many of the advantages of shared libraries stem from the fact that they are in fact shared. Do you have other applications which use the same DLLs which are also distributed publicly or might be in the future? If so, then sticking with the shared libraries can give several advantages. Typically, only one copy of the library is stored in memory, even if multiple applications use it, so it can reduce memory usage. It also simplifies upgrades, as a change to the library will only affect the DLL itself, where as if it is statically linked into one or more applications, they must all be upgraded when the library changes.

It's been a while since I did much with .NET, but I was always fairly happy with the GAC and support for library versioning it provided. Do you have a compelling reason to not use shared libraries? I suspect that in most cases, reducing the application to a single file is not enough of a convenience to outweigh the potential advantages.

Andrew Beyer