[英]TeamCity/.sqlproj build via MSBuild — FAILED
It all started with the VS2017 runner type within TC. 这一切都始于TC中的VS2017转轮类型。 It was failing without any errors or hints (except the (default targets) -- FAILED.
message on the solution level). 它没有任何错误或提示失败(除了解决方案级别的(default targets) -- FAILED.
消息)。 I narrowed it down to the .sqlproj'ects. 我把它缩小到了.sqlproj'ects。 These are not building via MSBuild, they do compile perfectly within VS2017 on the build agent. 这些不是通过MSBuild构建的,它们在构建代理上的VS2017中完全编译。 I was blaming SSDT for it... but I guess I checked everything. 我正在责备SSDT ......但我猜我检查了一切。 This is the problem which bubbles up to the solution level within the TC build: 这是在TC构建中达到解决方案级别的问题:
I noticed that for VS2017 SSDT comes with the VS setup. 我注意到对于VS2017,SSDT附带了VS设置。 The "Workload" "Data storage and processing" is installed and so is "SQL Server Data Tools" under "Individual components". 安装了“工作负载”“数据存储和处理”,“单个组件”下的“SQL Server数据工具”也是如此。 I noticed on https://docs.microsoft.com/EN-US/sql/ssdt/download-sql-server-data-tools-ssdt the sentence "If you are using SSDT with Visual Studio 2017, install the AS and RS components". 我注意到https://docs.microsoft.com/EN-US/sql/ssdt/download-sql-server-data-tools-ssdt句子“如果你在Visual Studio 2017中使用SSDT,请安装AS和RS组件”。 Did it. 做到了。 Nothing changed. 没有改变。 SSDT is also installed separately for previous versions. SSDT也为以前的版本单独安装。
This stack is related but it didn't help me. 这个堆栈是相关的,但它没有帮助我。
Any other ideas? 还有其他想法吗?
I came a step further. 我走得更远了。 Beside VS the Build Tools are installed as well on the build agent and TeamCity's runner for VS2017 obviously uses MSBuild from the Build Tools. 除了VS之外,构建工具也安装在构建代理上,而TeamCity的VS2017运行器显然使用了构建工具中的MSBuild。 As you can see above I was reproducing the issue with MSBuild from the Build Tools as well. 正如您在上面所看到的,我也在使用Build Tools中的MSBuild重现了这个问题。 If I pick the MSBuild "version" of VS2017 it works like a charm (as it does right within VS). 如果我选择VS2017的MSBuild“版本”,它就像一个魅力(就像在VS中一样)。 To make it short: 简而言之:
DOES NOT WORK 什么都不行
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin
WORKS 作品
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin
I found a blog post from Lukie Briner , his last paragraph pointed me to the solution (thank you buddy!). 我找到了Lukie Briner的博客文章,他的最后一段向我指出了解决方案(谢谢伙计!)。
Still don't know why/how this can happen, maybe it is related to the order of the installations of Build Tools, SSDT, Visual Studio etc.? 仍然不知道为什么/如何发生这种情况,也许它与Build Tools,SSDT,Visual Studio等的安装顺序有关?
The reason: SSDT was missing in the Build Tools and its version of MSBuild. 原因是:BuildT及其版本的MSBuild中缺少SSDT。
What I have done: 我做了什么:
Copy the SSDT
folder from 复制SSDT
文件夹
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\Microsoft\\VisualStudio\\v15.0
to 至
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\Microsoft\\VisualStudio\\v15.0
. C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\Microsoft\\VisualStudio\\v15.0
。
WOW! 哇! I finally see a REAL error message : 我终于看到一条REAL错误消息 :
Now I had to copy SQLDB
and SQLEditor
(I think SQLCommon
already existed in the destination folder, if not it should also be copied) from 现在我不得不复制SQLDB
和SQLEditor
(我认为SQLCommon
已经存在于目标文件夹中,如果不是也应该被复制)
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\Extensions\\Microsoft
to 至
C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\Common7\\IDE\\Extensions\\Microsoft
and BOOM... 和BOOM ......
And yes, the VS2017 runner from TeamCity is also happy with it. 是的,来自TeamCity的VS2017赛跑者也很满意。
Seems like the issue with Build Tools and SSDT has been solved now and you don't have to mess with manual copy of targets directories anymore (Visual Studio Build Tools 2017 v15.9.8). 看起来像Build Tools和SSDT的问题现在已经解决了,你不必再乱用目标目录的手动副本了(Visual Studio Build Tools 2017 v15.9.8)。
Build should work now. 构建现在应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.