Embedd dll.

Nov 24, 2011 at 4:19pm
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.
Nov 24, 2011 at 6:09pm
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 Nov 24, 2011 at 6:32pm
Nov 24, 2011 at 6:25pm
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 Nov 24, 2011 at 6:30pm
Nov 24, 2011 at 7:04pm
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.
Nov 28, 2011 at 6:42pm
I'm not sure, but you can try boxedapp. It provides such an opportunity.
Nov 28, 2011 at 6:44pm
Thanks to all)
Topic archived. No new replies allowed.