views:

93

answers:

1

Hi I have a problem with a dependency hierarchy I am unsure how to solve:

http://img525.imageshack.us/my.php?image=56330713it2.jpg

The problem is with how I should reference these dependencies from MyProject project. I have built BaseProject and the CommonUtil(version 1.0) it was built with into assemblies. Now in MyProject I am using classes from CommonUtil and I am unsure if I should reference the CommonUtil.v.1.0 or if I could/should reference the current version of CommonUtil (v 2.0).

Which CommonUtils assembly should I reference from my MyProject? I cannot reference both assemblies as VS tells me it cannot determine which assembly to use as they both contain some of the same methods. If I only reference v.1.0 I would perhaps not have everything I need from v.2.0 and If I only reference v.2.0 I would perhaps not have all capabilities in v.1.0 (which BaseProject) needs.

+1  A: 

If you are using the classes that BaseProject returns directly within MyProject, you need to stick with the same version (1.0). But if BaseProject only uses those classes internally and does not share with MyProject, you can safely use the new version (2.0).

Best practice: strongly name your assemblies so that the compiler can help you out.

Michael L Perry
By this you mean I should put my strongly named assemblies into the GAC?
Not necessarily. That's just one advantage to the strong naming. Another is that you can track dependencies on particular versions of shared libraries. Check out the "Specific Version" property of a project reference.
Michael L Perry