Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a reason to create a .net DLL rather than EXE if file is used as a referenced assembly?

I noticed that I can add a reference not only to a DLL but also to an EXE in Visual Studio and access all classes in the EXE as it if were a DLL.

Is there any reason to create a DLL or can I just as well reference the EXE?

I am asking because I often write .net programs that I run both under Windows and under Mac OS and my usual solution is to create a DLL with the functionality and then two GUIs, one for each target.

However, it now seems to me as if I could just write a Windows version of my app and then add that Windows version (the EXE file) to my Mac project and reference the Windows EXE rather than a DLL. It also has the added advantage that I can run the Windows version from the Mac folder without adding another file.

Is there any good reason not to do it that way?

like image 965
Andrew J. Brehm Avatar asked Aug 24 '11 11:08

Andrew J. Brehm


1 Answers

It depends on how much maintenance/update you would end up doing to the applications. I like the cleanliness of the original model, where the UI is separated based on platform, and the DLLs contain the classes that are shared. I would find it less confusing for maintenance/refactoring.

like image 139
Jennifer S Avatar answered Jan 04 '23 07:01

Jennifer S