Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dll not copying to bin folder

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?

like image 606
Dan H Avatar asked Oct 01 '10 19:10

Dan H


3 Answers

  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.
like image 127
Vinay B R Avatar answered Nov 17 '22 11:11

Vinay B R


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.

like image 20
Oscar Avatar answered Nov 17 '22 09:11

Oscar


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.

like image 4
Ognyan Dimitrov Avatar answered Nov 17 '22 10:11

Ognyan Dimitrov