Reputation: 945
I am using MonoDevelop to develop 2 simple C# programs in separate solutions.
Due to their nature, they share a similar codebase. A large number of objects is identical among these two programs.
I would like to merge these two solutions into a single one, but I would need that single solution to generate two separate .exe files when build (and therefore I would need to implement two different main() functions etc.).
Is this possible? If not, what alternatives do I have to merge the code shared between solutions?
Upvotes: 2
Views: 4180
Reputation: 4519
You split your solution into three projects:
DLL / Class Library
EXE 1
EXE 2
The DLL should contain as much of the code shared by the two exes as possible. This is DRY as you can change it for both programs at the same time.
Even better, if one day you decide to convert one of the .exes into a different type of application, i.e. web app, or mobile app for windows phone, you don't need to rewrite everything.
Upvotes: 2
Reputation: 11025
Make a single solution and include both existing projects. Then put all the shared code into its own (new) project and use a project reference in the two existing projects. You will still get a common DLL to share (built by the new project, which should be a Class Library).
Upvotes: 2