Visual Studio fails to build the solution “S1” with this error message:
Error 8: The referenced assembly “D:\S0\foo\bin\Debug\foo.dll” was not
found. If this assembly is produced by another one of your projects,
please make sure to build that project before building this one.
The referenced foo project is in fact originally part of a different solution (called S0 as seen in the error message) and got included via “Add existing project”.
However, Foo did build fine in S0 and its bin output exists. Since both S0 and S1 exclusively build for x86, the correct path should be “S0\foo\bin\x86\Debug\foo.dll”, so it appears Visual Studio does not look for the binary file in the right place.
Foo does show missing references in S1, likely due to its references to other projects from S0 which are not included in S1. This should not be an issue though, since the required binary files already exist.
I manually copied the files from ‘bin\x86\Debug’ to ‘bin\Debug’ and while not removing the warnings about missing references, this actually made VS build S1 fine, so apparently Visual Studio actually got confused by the “unusual” ‘bin\x86\debug’ path.
How should I solve this issue?
Your build output location is customisable. I believe the standard VS behaviour is to create the
x86folder if other platform configurations exist for the project.This isn’t a Visual Studio bug; it sounds like (although the project is in the solution) you have a binary reference that has been created with an incorrect path.