Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

csc.exe and inter-dependent assemblies

Tags:

c#

.net

csc

I've been working on a project, and as it's grown I realize that two parts that cannot be joined together are inter-dependent.

Let's call these two parts a.exe and b.dll. b.dll provides an implementation that allows a.exe to retrieve data, but I want it to be its own standalone assembly so that it can easily be changed out to make a.exe communicate with different data sources.

However, while a.exe is required to reference b.dll, b.dll requires several functions that are an inseparable part of a.exe.

Since I've been compiling -- to test -- as I've been writing this project, a.exe and b.dll both exist, and I can compile b.dll against a.exe and a.exe against b.dll, but how would/can I ever rebuild both of these from source?

like image 345
Robert Allan Hennigan Leahy Avatar asked Dec 19 '11 18:12

Robert Allan Hennigan Leahy


1 Answers

I would refactor your system into three assemblies:

  • a.exe - Main EXE nothing should reference this
  • b.dll - As you have it today, but does not reference a.exe, it references c.dll
  • c.dll - This should contain the common pieces / parts that both a and b need to reference
like image 180
JoshBerke Avatar answered Oct 13 '22 11:10

JoshBerke