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?



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):

Include="SmartAssembly.Attributes, Version=, 
       Culture=neutral, PublicKeyToken=b03f1f7f1ad5da3a,

  <!-- The HintPath below should exist and be valid in your build server -->


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

and therefore more general. For example:



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



All Articles