TFS 构建服务器因 Reporting Services 项目而失败

TFS Build Server fails with Reporting Services project

我有一个 Visual Studio 2015 解决方案,其中包含一个 Reporting Services 项目 (*.rptproj),用于在我们的 TFS 构建服务器上构建良好。

我将解决方案升级到 Visual Studio 2017,现在它在 CI 构建期间失败并出现以下错误:

<Reporting-Services-Project-Path>\<Reporting-Services-Project-Name>.rptproj (57, 11)
The imported project "C:\Program Files (x86)\Microsoft Visual Studio17\BuildTools\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" was not found. Also, tried to find "Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio17\BuildTools\MSBuild.0\Bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Process 'msbuild.exe' exited with code '1'.

我们使用的是 TFS 2015。我已将 Visual Studio Build Tools 2017 更新到最新版本 15.9.6,但这没有帮助。

SSDT 未包含在 Visual Studio Build Tools 2017 中。

要使构建正常运行,需要从您的开发人员 PC 手动复制所需的文件。

在我的例子中,我从 C:\Program Files (x86)\Microsoft Visual Studio17\Professional\MSBuild[=21= 复制了 Reporting Services 文件夹] 在我的开发者 PC 上到构建服务器上的 C:\Program Files (x86)\Microsoft Visual Studio17\BuildTools\MSBuild

构建成功。