I've written an Assembler, Interpreter, and Disassembler for MIPS.
They're split each into their own projects, with a base project containing some basic models to use between each.
One of those models is an Instruction struct. I would like to add a DebugDisplayAttribute to this struct that uses the disassembler to display the instruction.
I don't want these components to be co-dependent in a release build, so I do need them to be separate projects. However, in a debug build I would like to include the disassembler in the base for this DebugDisplayAttribute
Ideally, I'd simply make the disassembler conditionally referenced by the base project to include in debug builds, however since the disassembler depends on the assembler, and both the disassembler and assembler depend on the base project, this introduces a cycling dependency.
Is there some way to add an attribute to a struct from a different project? Some way to make the projects co-build in this respect? Some better solution entirely? Or do I need to write a bunch of conditionally compiling dependency injection code for this (which would be weird because then the service has to be set before it can be used).