0

CIn our .NET application we have project A that reference an infrastructural project, let's call it Infra. Now, project A also references project B, which resides in a different solution, referencing another version of the Infra. The top level application, project C, references project A.

While this compiles just fine, it has another side effect - it does not copy the Infra.dll to the bin folder of project C.

I increased the verbosity of the build output, to see what exactly is the problem, and saw this:

There was a conflict between "Infra, Version=1.1.14.9..." and "Infra, Version=1.0.0.0 ...". "Infra, Version=1.1.14.9" was chosen because it had a higher version.

That actually makes a lot of sense, having 2 conflicting references to the same version should try to get the higher version. The problem is that B project's reference to Infra is not an accessible path and therefore will not be copied.

I could surly solve this issue by adding a reference form project C directly to infra, but I would prefer not to. I was wondering whether I could tell the compiler explicitly which version to use.

Any ideas?

Mohoch
  • 2,633
  • 1
  • 26
  • 26
  • 1
    Have a look at http://msdn.microsoft.com/en-us/library/twy1dw1e(v=vs.110).aspx. Should put you on the right path. – kha Jan 13 '15 at 08:36
  • Your question started with "we have project A that references Infra". And ends with "I can solve this problem by having A reference Infra". That makes no sense. – Hans Passant Jan 13 '15 at 08:36
  • @HansPassant I think what he means is that `A` and `B` both reference Infra albeit with different versions and he'd like to instruct CLR which version of the two it should load when resolving the assemblies. At least that's how I understood the question. I agree the wording on the last paragraph is a bit confusing though and I may have completely got his question wrong because I don't quite understand it. – kha Jan 13 '15 at 08:44
  • @HansPassant you are right. I will fix the question – Mohoch Jan 13 '15 at 09:11
  • possible duplicate of [Add compile parameter to csc command using Visual Studio IDE](http://stackoverflow.com/questions/18849637/add-compile-parameter-to-csc-command-using-visual-studio-ide) – Paul Sweatte Jul 24 '15 at 01:16

0 Answers0