I have a solution structure like in Ports And Adapters Architecture or Onion Architecture. My composition root (a web application in this case) and infrastructure libraries only reference the core library.
I can also load infrastructure libraries at runtime using Castle Windsor. However I do not reference these libraries on my composition root so their build output is not copied to the output folder. I guess I need a custom build step but I don't know how I can accomplish this.
I ended up with setting unreferenced projects' output path same same as the web application's.
..\WebApp\bin
This works well for building the solution inside Visual Studio. For release builds (only building the Website project) I wrote a custom script that builds Web application and other libraries. After those libraries are built, all dll files are copied to WebApp\bin
folder inside _PublishedWebsites
using a Copy task.