views:

9

answers:

1

when I try to build the solution with many projects, i get the following error:

Error: The dependency 'myproject1.myproject2, Version=1.0.3799.25569, Culture=neutral' in project 'myproject3.myproject4' cannot be copied to the run directory because it would conflict with dependency 'myproject1.myproject2, Version=1.0.3841.15015, Culture=neutral'.

What should I do? I have deleted all the binaries under the bin folder for all the projects and rebuilt but this error will not go away. Please help.

A: 

An easy fix should be to set the "Copy Local" property of the Reference dll in question to "false". This will stop VS from trying to copy an older dll to a place that has a newer dll.

The harder but more correct solution would be to check why you are using two different versions of the same dll. Perhaps you should remove the reference from your project myproject3.myproject4, rebuild your myproject1.myproject2, then add the newly built dll to your rpoject.

sbenderli
I wonder what causes this problem. Is there a way, I could write a simple hello world program and try to recreate this issue so I could understand it better? I really do not understand what is causing this.
dotnet-practitioner