Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some dll from nuget packages are not copied to /bin

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! *

like image 225
Erik Pettersson Avatar asked Jun 24 '13 17:06

Erik Pettersson


People also ask

How do I fix a missing NuGet package?

Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

How do I get NuGet package DLL?

Just build the class library by clicking the right click on solution explorer and you will see the NameOfLibrary. dll file in packages folder of your project directory. packages folder isn't displaying as folder in solution explorer. You can see them as References.

How do I debug a NuGet DLL?

In order to debug into NuGet package libraries, Visual Studio must be configured to use ProGet as a symbol server. To do this select Debug > Options, from the menu bar, then browse to Debugging > Symbols in the tree menu.

Where are NuGet packages references stored?

The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).


Video Answer


1 Answers

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
like image 167
Oscar Fraxedas Avatar answered Oct 11 '22 06:10

Oscar Fraxedas