Error: the dependency 'file' in project 'project' cannot be copied to the run directory because it would conflict with dependency 'file'

 

There is a conflict between references; more than one distinct dependency with the same file name being copied to the bin directory for the application to run. The run directory cannot resolve the conflict because none of the dependencies are primary references.

This error will cause the build to fail.

Double-clicking this Task List item will take you to the references node of the project in which the conflict is occurring.

To correct this error

  • Make one of the assemblies a direct reference of your project. A possible downside to this approach is that the assembly you choose is not guaranteed to work with assemblies that require some other version of the referenced assembly.

    - or -

  • Make sure that both copies of the assembly are strong-named and in the global assembly cache. This eliminates the need to copy the assemblies to the bin directory.

Show: