MSBuild no copia una DLL, mientras que Visual Studio lo hace

In our Visual Studio 2010 project we reference - among the others - the SmartAssembly.Attributes.dll and it's properly copied to the Bin/Debug or Bin/Release folder of our local dev machines. On the build server this is true for all other references but not for 'SmartAssembly.Attributes.dll'. The build succeeds.

¿Qué debo comprobar?


preguntado el 09 de marzo de 12 a las 15:03

1 Respuestas

Abra su .csproj archivo (o .vbproj file), and look for the assembly reference. Then make sure the hint path is still valid in your build server. Sometimes VS2010 will add an absolute hint path, instead of using one relative to the .csproj file itself, so the drive letter may be invalid in another machine.

For example, the reference may look similar to the one below (I made up all of the XML below to illustrate only and it's NOT valid), and the absolute hint path may be invalid in the build server (e.g. there's no drive letter d allí):

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 make it relative to the .csproj file and therefore more general. For example:


Another problem may be that <Private>true<Private> isn't there. This attribute mapped to the CopyLocal property in Visual Studio, so if it's missing from your .csproj, the DLL won't get copied to bin\Debug or bin\Release by MSBuild. See

respondido 09 mar '12, 15:03

Thanks Diego, it's just what we are doing <HintPath>..\Bin\SmartAssembly.Attributes.dll</HintPath> - abenci

I added a comment. I think you may be missing <Private>true<Private>. - Diego

None of the DLLs we reference have this <Private>true<Private> attribute and they all are copied... - abenci

I would try it anyway. See… - Diego

If "Private" is not defined, it IDE defaults to true. However, forcing the entry in there helps with build issues. - granadaCoder

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.