Embedd dll.

I want to embed a pre-existing DLL into a compiled C# executable (so that you only have one file to distribute). If it is possible, how would one go about doing it?
Thank.
Would compiling it into the resource segment and then unpacking it to use work for you? Or were you wanting to actually somehow link it in in-place somehow (the former is routine; the latter I have never tried to do)

This thread might help:
"Embedding DLLs in a compiled executable"
http://stackoverflow.com/questions/189549/embedding-dlls-in-a-compiled-executable
Last edited on
And a thread from 2006 asking the same question

How to compile DLL into project so DLL not needed
http://www.gamedev.net/topic/415896-how-to-compile-dll-into-project-so-dll-not-needed/

with reasons why the second approach won't fly :-(

Is it a DLL you have the source for???
Last edited on
What you could do, although it's a bit nasty, is have a helper executable that contains the executable and the DLL as arrays. When it's ran, it writes both to separate files and runs the executable. Then it waits for it to finish and then deletes the files.
This takes the least amount of effort, but I wouldn't do it if I could avoid it.
I'm not sure, but you can try boxedapp. It provides such an opportunity.
Thanks to all)
Topic archived. No new replies allowed.