c# - TFS 构建失败。对源代码管理中的文件的未解决引用

我有一个可以在本地正常工作的构建,但是不能在我们的 TFS 环境中构建。

我收到以下错误;

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1578): Could not resolve this reference. Could not locate the assembly "Assembly.Services.Common". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

相关程序集已检入 TFS 并位于以下位置;

/Root/BaseBinRefs/Assembly.Services.Common.dll

它在 .net 框架之外没有任何外部引用。

构建失败的项目位于 TFS 中的以下位置

/Root/Services/AssemblySolutionFolder/AssemblyThatIsFailing

该程序集在解决方案中的项目中被引用,并且该程序集的 HintPath 似乎是正确的;

   <Reference Include="Assembly.Services.Common, Version=1.0.0.0, 
      Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\BaseBinRefs\Assembly.Services.Common.dll</HintPath>
    </Reference>

如前所述,它是在本地构建的,我看不出它为什么会在 TFS 内失败。需要注意的是,总的来说,我是 TFS 的新手,并且仍在尝试将我们的第一个项目集成到这个环境中。

更新 1

使用 ProcessMonitor,我看到 TFS 试图从中加载文件;

C:\Builds\1\Root\BaseBinRefs\Assembly.Services.Common.dll

这不存在,但在相对意义上是正确的。现在,当我查看 Sources 目录时,我看到了 BaseBinRefs,其中包含 Assembly.Services.Common.dll,所以它已经下载了它们(我将 BaseBinRefs 添加到构建定义中)

最佳答案

这可能是关于如何在您的构建定义中设置工作文件夹(在工作区下)的问题。

如果我正确理解了您的路径方案,则应按以下方式设置路径:

Active |$/TeamProject/Root/BaseBinRefs/                    |$(SourceDir)\Root\BaseBinRefs
Active |$/TeamProject/Root/Services/AssemblySolutionFolder/|$(SourceDir)\Root\Services\AssemblySolutionFolder

而例如,这会引起麻烦:

Active |$/TeamProject/Root/BaseBinRefs/                    |$(SourceDir)\
Active |$/TeamProject/Root/Services/AssemblySolutionFolder/|$(SourceDir)\

https://stackoverflow.com/questions/12102575/

相关文章:

r - 在 RStudio 中构建包时如何解决 Rd 警告 "missing file link"?

node.js - 构建工具 : Coffeescript/Node project with mu

plugins - Jenkins 插件基于控制台输出失败构建

Android - 测试版与生产版

eclipse - 您知道 *latest* eclipse 组件的更新站点地址吗?

maven-2 - 使用 maven-assembly-plugin 构建一个 jar 并将其包含在

build - Leiningen 在构建工作 uberjar 时遇到问题

build - 如何在 MultiJob 插件中传递内部版本号?

vim - 在vim中设置一个 "build directory"?

javascript - SystemJS 和 CommonJS 有什么区别