1

This has been asked a few times but the various other answers relate to Client Profile which isn't the issue in this instance.

I have a solution file which has the following structure:

  • Solution
    • Project 1
      • Nuget Reference to ServiceStack
    • Project 2
      • Project Reference to Project 1

The problem is the nuget package references ServiceStack.Common which it happily brings through into Project 1 but when Project 2 is built, the reference is not carried through (I'm assuming that it's because it's not used anywhere).

Looking around at other people who have had this before, they tend to just reference ServiceStack.Common in Project 2 as that resolves it but surely there's a better way?

PhiS
  • 4,270
  • 21
  • 34
Tim
  • 4,673
  • 2
  • 19
  • 26
  • possible duplicate of [Msbuild doesn't copy references (dlls) if using project dependencies in solution](http://stackoverflow.com/questions/1132243/msbuild-doesnt-copy-references-dlls-if-using-project-dependencies-in-solution) – Oded May 10 '12 at 09:13
  • That sounds similar yes but Copy local is already set to true (and ServiceStack.Common exists in the bin folder of Project 1, just not 2). I suspect I'll have to add a reference – Tim May 10 '12 at 09:27
  • You may want to set it to False, save then set to True and save (just to be sure). – Oded May 10 '12 at 09:30
  • Sadly no luck, I ended up adding the reference to project 2 – Tim May 17 '12 at 05:49

1 Answers1

0

If you want to carry ServiceStack.Common without even referencing it then you may xcopy it to the required path in Project2 Project Properties -> Build Events under Post or Pre build event command-line option.

Henrik
  • 22,652
  • 6
  • 38
  • 90
Yatin
  • 76
  • 6
  • 1
    This is worse than adding the reference. – Oded May 10 '12 at 08:45
  • I agree, I don't really want to do either on the basis that Project 1 may add another dependency with a similar situation... – Tim May 10 '12 at 09:25