13
votes

I know that this is a question that has been discussed before but I have a situation that I don't understand.

I have the following projects

  • Project A
    • Project B
      • NuGet Package "log4net"
      • NuGet Package "ServerAppFabric.Client"

Project A has a visual studio reference to Project B. I'm using both packages in code in Project B and I am building in debug mode. Project B config looks like this.

<Reference Include="log4net">
  <HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.Client">
  <HintPath>..\packages\ServerAppFabric.Client.1.1.2106\lib\Microsoft.ApplicationServer.Caching.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationServer.Caching.Core">
  <HintPath>..\packages\ServerAppFabric.Client.1.1.2106\lib\Microsoft.ApplicationServer.Caching.Core.dll</HintPath>
</Reference>

*Why is only the dll-file from log4net copied into the bin folder of Project A and not the Client and Core files? Any help or explanation is appreciated! *

2
Which are the target frameworks of ProjectA and ProjectB?Ufuk Hacıoğulları
Both are using version 4.5Erik Pettersson
Tried with some other framework configurations but the same problem. Could it be related to if the files already exit in gac?Erik Pettersson
Maybe. Let me create a solution on my machne and see if the same thing happens.Ufuk Hacıoğulları

2 Answers

5
votes

I had the same problem with a somehow complex dependency graph.

  1. Go to the Reference Properties and set Copy Local=True.
  2. Compile and check if the assembly was copied to the bin folder.
  3. If that doesn’t fix your issue try this answer: https://stackoverflow.com/a/19889803/1074245
3
votes

I don't think this is related to NuGet. It should be related to how references work in Visual Studio or MSBuild. If you just reference a library in ProjectB, it won't show up in ProjectA's bin folder. However, when you use some type from the referenced library,only then it will show up in bin folder.