Dll not copying to bin folder

29,037

Solution 1

  1. right click on the referenced dlls and check if copy local is true.
  2. you can also try readding your references once, this had resolved a similar problem for me when i had converted a VS2005 project to VS2008 project.

Solution 2

I had a similar problem with external references. The thing is that the unused libraries are not copied. Do you use the Devart libraries from your projectB? Any instance, inheritance, anything, ...?? Please try this: Instansiate some mock class from the three libraries in your projectB and recompile. It has worked for me. I would like get to the formal explanation.

Solution 3

The problem appears too when you have dlls that are dependencies of others. For example Microsoft.ApplicationServer.Caching.AzureClientHelper.dll is used internally by Microsoft.ApplicationServer.Caching.Client. Even though I have copyLocal = True the helper assembly is not copied because it is not referenced anywhere directly in my code. To avoid this problem you can make a private type variable like this :

Type dependsOnThisTypeOfAssembly = typeof(TypeFromDependentAssembly);

This will make a reference to the type and the assembly will be copied locally while in the build process.

Solution 4

Set as Copy local doesnt work for me. The only thing that resolves (is unusable) is to reference some type contained in assembly.

Share:
29,037
Dan H
Author by

Dan H

Software developer

Updated on December 16, 2020

Comments

  • Dan H
    Dan H over 3 years

    I'm having an issue with Devart DLLs not getting copied to the bin folder of my web app. I have my web app project that references projectA. ProjectA references projectB. The Devart Dlls are used in projectB and are not being copied into the web app projects bin folder during a build. ProjectB also references EL Unity dlls and they are being copied correctly. All of the Dlls in question are physically located in a folder in projectB and that is where the reference point. (I don't have the references pointing to the GAC)

    The dlls that copy correctly are Microsoft.Practices.Unity, Microsoft.Practices.Unity.Configuration and Microsoft.Practices.ServiceLocation.

    The dlls that are not being copied correctly are Devart.Data, Devart.Data.Oracle and Devart.Data.Oracle.Design.

    Here's the references for each dll...

    <Reference Include="Devart.Data, Version=5.0.124.0, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL">
      <HintPath>..\Dtn.PetroDex.Dal\ThirdPartyDlls\Devart.Data.dll</HintPath>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
    <Reference Include="Devart.Data.Oracle, Version=5.70.170.0, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\Dtn.PetroDex.Dal\ThirdPartyDlls\Devart.Data.Oracle.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="Devart.Data.Oracle.Design, Version=5.70.170.0, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\Dtn.PetroDex.Dal\ThirdPartyDlls\Devart.Data.Oracle.Design.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\Dtn.PetroDex.Dal\ThirdPartyDlls\Microsoft.Practices.ServiceLocation.dll</HintPath>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\Dtn.PetroDex.Dal\ThirdPartyDlls\Microsoft.Practices.Unity.dll</HintPath>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.Practices.Unity.Configuration, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\Dtn.PetroDex.Dal\ThirdPartyDlls\Microsoft.Practices.Unity.Configuration.dll</HintPath>
      <SpecificVersion>False</SpecificVersion>
      <Private>True</Private>
    </Reference>
    

    Anyone else having this issue? Am I doing this wrong? Thanks

    EDIT I opened a file monitor and watched where visual studio was loading the reference and for Unity it was getting the dlls from the location I specified. But, for the Devart dlls it's looking in the GAC! Could the Devart dlls be causing this somehow?

  • Dan H
    Dan H over 13 years
    I do have copy local equal to true. I re-added the Devart references way more than once...trust me. It seems like it's only the Devart dlls. Could they have an issue that is causing this?
  • Vinay B R
    Vinay B R over 13 years
    i cant think of anything else, u could probably try copying theses during post build or refering the dlls directly from the projectA
  • Vinay B R
    Vinay B R over 13 years
    also if you have the devart dlls in GAC try removing them and rebuilding your projects
  • Dan H
    Dan H over 13 years
    How do I safely remove them from the GAC?
  • Vinay B R
    Vinay B R over 13 years
    what do u mean by safely remove from gac? the dlls were probably copied to gac when u installed devart, try uninsatalling it or else type assembly in run window and press enter. search for devart dlls right click and select uninstall.
  • Dan H
    Dan H over 13 years
    removing the dlls from the gac worked. Seems weird to have to do that. Thanks!
  • CBono
    CBono almost 11 years
    Removing / re-adding the reference didn't work for me. However, I changed the "Copy Local" property to false and then back to true, and that worked.