tags:

views:

45

answers:

3

I am writing a project which makes use of the MS Chart for .net 3.5 utility.

However, either all users will also need to install this, or I need to package the dll with the program.

I can get Visual Studio to copy the dll to the folder with the program, but is it possible to make it embed the dll, so that there is only the one file?

I have seen several external programs out there, but surely there must be a way in Visual Studio - and would it work with a MS .net dll?

A: 

Generally you would need some form of post build tool to perform an assembly merge like you are describing. There is a free tool called Eazfuscator (eazfuscator.blogspot.com/) which is designed for bytecode mangling that also handles assembly merging. You can add this into a post build command line with Visual Studio to merge your assemblies, but your mileage will vary due to issues that will arise in any non trival assembly merging scenarios.

You could also check to see if the build make untility NANT has the ability to merge assemblies after building, but I am not familiar enough with NANT myself to say whether the functionality is built in or not.

There are also many many Visual Studio plugins that will perform assembly merging as part of building the application.

Alternatively if you don't need this to be done automatically, there are a number of tools like ILMerge that will merge .net assemblies into a single file.

The biggest issue I've had with merging assemblies is if they use any similar namespaces. Or worse, reference different versions of the same dll (my problems were generally with the NUnit dll files).

wllmsaccnt
Eazfuscator will just call IlMerge, AFAIK.
Bobby
+1 Bobby. I Should have remembered that. About all Eazfucator does for you is abstract the actual calls to ILMerge with a more general config file.
wllmsaccnt
+1  A: 

ILMerge does exactly what you want.

plinth
+1  A: 

Yes, it is possible to merge .NET executables with libraries. IlMerge and Mono mkbundle do offer such a functionality (you can combine this with Mono Linker, which does mimify the executables and libraries).

Bobby