Seems like I would have discovered this a while ago but it turns out that Visual Studio doesn’t copy project/assembly references of project/assembly references when building your solution.
For example, if your project X references Project A, which in turn references Project B, only the Project A assembly will be copied to the runtime folder when building project X, which will cause your application to crash due to the missing dependency (Project B assembly).
Not sure if this is a bug or by design (there may be issues of copying cascading references that I’m not thinking of at the moment). Either way, you have at least two options as workarounds…
- Add a reference to Project B in Project X.
- Add a post-build event to Project X to copy the Project B assembly.