baynezy
baynezy

Reputation: 7066

Combine dependencies into a console application

I have a console application that I have created in C#. I have specifically separated it out into 3 solutions:-

  1. Class Library
  2. Unit Tests for Class Library
  3. Console Application

The console application is specifically dumb. It just takes the arguments and passed them to the classes in my class library.


In its current form I have to deploy the exe with the dll for my class library. Now I would rather be able to deploy the exe stand alone without the added complication of the the dependency on the dll. I want to keep the class library separate as the functionality in it is useful for other applications I am building.

So my question is; is there a way to bundle dependent libraries in with the exe when I build the console application?

Thanks.

Upvotes: 2

Views: 1342

Answers (1)

Oded
Oded

Reputation: 499382

You can use ILMerge to combine assemblies in this way.

ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output.

This would be an extra process after building, though you should be able to automate it.

Upvotes: 4

Related Questions