Search code examples
dllbuildmsbuildbin

Msbuild not copying a ProjectReference to bin folder


To prevent circular dependency, i had to make a reference from (lets say) project A, to B's bin folder. When i run a rebuild or build in Visual Studio it creates bin folder and required dll references by A, under B project.

But msbuild command does not work that way. It does not create bin and dlls under B. I investigate the problem, found some solutions like using dummy class user method to make msbuild copy references under bin. But it did not work too.

Project A -> Project B/bin/C Dlls ->Project C

Project C Dlls required by Project A.

What do i have to do to make msbuild command create bin folder under B project?


Solution

  • It looks like the circular dependency is still present. It has only been circumvented by going directly to the bin folder. This bypasses the safeguards that call out a circular dependency at build time.

    As a general rule, if you need to go directly to the bin folder then there's a problem.

    I suggest refactoring the projects to remove the circular dependency.