繁体   English   中英

在Visual Studio中,MSBuild不会复制DLL

[英]MSBuild not copying a DLL, while Visual Studio does

在我们的Visual Studio 2010项目中,我们引用了SmartAssembly.Attributes.dll并将其正确地复制到本地开发机器的Bin/DebugBin/Release文件夹中。 在构建服务器上,这适用于所有其他引用,但不适用于“SmartAssembly.Attributes.dll”。 构建成功。

我该怎么检查?

谢谢。

打开.csproj文件(或.vbproj文件),然后查找程序集引用。 然后确保提示路径在构建服务器中仍然有效。 有时VS2010会添加绝对提示路径,而不是使用相对于.csproj文件本身的一个,因此驱动器号在另一台机器中可能无效。

例如,引用可能看起来类似于下面的引用(我编写了下面的所有XML以仅说明它并且它无效),并且绝对提示路径在构建服务器中可能无效(例如,那里没有驱动器号d ):

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

您可以更改HintPath以使其相对于.csproj文件,因此更通用。 例如:

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

另一个问题可能是<Private>true<Private>不存在。 此属性映射到Visual Studio中的CopyLocal属性,因此如果.csproj缺少该属性,则DLL将不会被MSBuild复制到bin\\Debugbin\\Release http://bronumski.blogspot.com/2009/06/project-reference-fun-and-games.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM