4

I have a .net solution that has two class library projects (Say A and B) that I am also publishing to a nuget server.

If I were to add A as a project reference as well as a nuget reference on B, what version of the A.dll should I expect in the bin folder of B when I compile?

Is there a rule which determines what reference gets precedence? What happens if the two dlls have different versions?

P.S - I am building from VS

KnightFox
  • 3,132
  • 4
  • 20
  • 35
  • I would think it either wouldn't matter (if they are the same) or you'd get a conflict (if they were different). I don't think VS will choose one over the other. – D Stanley Dec 08 '14 at 23:29
  • Do you mean a Build from VS, or an automated build, perhaps via TFS? – John Saunders Dec 08 '14 at 23:32
  • 1
    And are you using "NuGet package restore"? – John Saunders Dec 08 '14 at 23:33
  • @JohnSaunders - I did not have a specific build process in mind because I was assuming they would all be calling msbuild under the hood. – KnightFox Dec 09 '14 at 15:22
  • True - they would all use MSBUILD, but some might also use things outside of MSBUILD. There could be other differences as well, but it would be a better question (and answer) if it focused on one build environment at a time. – John Saunders Dec 09 '14 at 15:25

1 Answers1

0

This is moot question. Turns out you cannot have a referenced twice (as a project and nuget reference). Visual studio blocks you if you try to add a project reference if it already exists as a nuget reference and if you add a nuget reference when you already have a project reference of the same name then it gets overriden (your project reference goes away and is replaced by nuget reference)

KnightFox
  • 3,132
  • 4
  • 20
  • 35