MSBuild does not copy DLLs, while Visual Studio does

In our Visual Studio 2010 project, we reference - among others - SmartAssembly.Attributes.dll

and copy it correctly to the folder Bin/Debug

or Bin/Release

our local development machines. On the assembly server, this is true for all other references, but not for "SmartAssembly.Attributes.dll". Build completed successfully.

What should I check?

Thank.

+3


source to share


1 answer


Open the file .csproj

(or .vbproj

file) and find the assembly reference. Then verify that the hint path is still valid on the build server. Sometimes VS2010 will add an absolute hint path instead of using one relative to the file itself .csproj

, so the drive letter might not be valid on another machine.

For example, a link might look something like the following (I've compiled the entire XML below to illustrate this, and it is NOT allowed) and the absolute path of the hint might not be valid on the build server (for example, there is no drive letter d in there):

<Reference
Include="SmartAssembly.Attributes, Version=8.0.0.0, 
       Culture=neutral, PublicKeyToken=b03f1f7f1ad5da3a,
       processorArchitecture=x86"> 
  <SpecificVersion>False</SpecificVersion>
  <Private>true<Private>

  <!-- The HintPath below should exist and be valid in your build server -->
  <HintPath>d:\temp\SmartAssembly.Attributes.dll<HintPath>
</Reference>

      



You can change the HintPath to be file-relative .csproj

and therefore more general. For example:

  <HintPath>..\libs\SmartAssembly.Attributes.dll<HintPath>

      

Another problem might be that <Private>true<Private>

doesn't exist. This attribute is mapped to a property CopyLocal

in Visual Studio, so if it's missing from yours .csproj

, the DLL will not be copied to bin\Debug

or bin\Release

using MSBuild. See http://bronumski.blogspot.com/2009/06/project-reference-fun-and-games.html

+6


source







All Articles