Importing my dll's into a single console executable file

How can i compile a C# console application so that all of my dependent dll's are compiled into the executable?

Who is Participating?
BlackTigerXConnect With a Mentor Commented:
you can use the ILMerge tool
here's an example of how to use it, it's quite simple (but command line)

ilmerge /target:winexe /out:ResultExecutable.exe InputExecutable.exe SomeAssembly.dll SomeOtherAssembly.dll

check this article:
Daniel Van Der WerkenConnect With a Mentor Independent ConsultantCommented:
Reference this:

I'm pretty sure you're looking for the /reference command line option.
athapaCEO / CTOCommented:
I don't think you can embedd the referenced dll's inside your executable.

You could embed them  in your executable and then extract them during the runtime. But you'd have to load the assembly and acces the classes inside and it won't be as easy as just adding reference to the dependent dlls.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.