Imagine that I have decoupled my code beautifully:
- Library Contracts to one assembly
- Library Implementation to another assembly
- App code depends on the Library Contracts only
- MEF takes care of loading the right implementation at run-time
The only problem is - how do I get the Library Implementation assembly into the bin folder of the App, now that App does not depend on it?
(In fact, no code, except unit tests depend on Library Implementation, after all this is a perfect decoupling)
I know of two approaches:
- Make App depend on the Library Implementation project anyway.
- Some msbuild targets focus pocus to copy Library Implementation assembly into the App bin directory
But both feel as wrong. Is there a better way to achieve this goal?