简体   繁体   English

在TeamCity 7构建服务器上构建* .sqlproj SSDT项目时,*。dacpac文件的文件命名错误

[英]Erratic file naming of *.dacpac files when building a *.sqlproj SSDT project on a TeamCity 7 build server

We have an MSBuild task that builds our *.sqlproj file, the output of which is loaded back into TeamCity as an artifact for subsequent deployment. 我们有一个MSBuild任务来构建我们的* .sqlproj文件,该文件的输出作为后续部署的工件被加载回TeamCity。

Similar to this user, we are having some unpredictable output file naming happen: Invalid file names when trying to deploy SSDT project with TeamCity 8 与该用户类似,我们正在发生一些不可预测的输出文件命名: 尝试使用TeamCity 8部署SSDT项目时,文件名无效

It appears that sometimes, it produces this output file under /bin/Release: 有时似乎会在/ bin / Release下生成此输出文件:

MyProj.sqlproj.dacpac

Then subsequent builds produce this file in the same folder: 然后,后续构建将在同一文件夹中生成此文件:

MyProj.dacpac

We haven't done indepth testing yet - I was wondering if anyone else has seen similar or has a suggested troubleshooting path? 我们尚未进行深入测试-我想知道是否还有其他人看到过类似的建议或建议的故障排除方法?

To be clear, it's the same task, running the same command against the same project - just run repeatedly overtime as new checkins happen. 需要明确的是,这是相同的任务,对相同的项目运行相同的命令-只是随着新签入的发生而超时重复运行。

Sounds like you have conflicting .sqlproj files being checked in. 听起来您正在签入冲突的.sqlproj文件。

I'd start by checking the history. 我将从检查历史记录开始。

Well, after looking more closely at the build log I could see that the TeamCity MSBuild runner appears to be creating some temporary virtual project files (or something, I don't know for sure because they get deleted) with names like: 好吧,在仔细查看构建日志后,我可以看到TeamCity MSBuild运行器似乎正在创建一些临时虚拟项目文件(或某些我不确定的东西,因为它们被删除了),其名称如下:

MyProj.sqlproj.teamcity

I theorized that this may be confusing MSBuild or one of the targets related to building dacpacs, so I replaced the TeamCity MSBuild build step with a Command Line build step that calls MSBuild on the original project file itself, and this appeared to solve the problem. 我认为这可能会使MSBuild或与构建dacpac有关的目标之一混淆,因此我将TeamCity MSBuild构建步骤替换为在原始项目文件本身上调用MSBuild的命令行构建步骤,这似乎可以解决问题。 It now produces the dacpac with the file I'm expecting. 现在,它将生成带有我期望的文件的dacpac。

I don't have time to dig further now, but I could believe that there's some logic in the chain somewhere that is deriving the name for the final *.dacpac from the name of the project file being used. 我现在没有时间进行进一步的挖掘,但是我可以相信,在链中某些逻辑正在从所使用的项目文件的名称派生最终* .dacpac的名称。 My guess is that it just strips off everything after the last "." 我的猜测是,它只会剥离最后一个“”之后的所有内容。 and attaches the ".dacpac" suffix. 并附加“ .dacpac”后缀。

I don't fully know why it would occasionally create a *.dacpac file with the correct name, but I was at times doing a manual build in the TeamCity agent work folder from the commandline on the build server itself, so this may have just been a file leftover from previous executions. 我不完全知道为什么有时会使用正确的名称创建* .dacpac文件,但是我有时会从构建服务器本身的命令行在TeamCity代理工作文件夹中进行手动构建,所以这可能只是是以前执行中剩余的文件。

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

相关问题 Visual Studio SSDT 数据库项目 (.sqlproj) 构建 - 使用没有 MSBUILD (msbuild.exe) 的 CLI 生成.dacpac - Visual Studio SSDT Database project (.sqlproj) build - generate .dacpac using CLI without MSBUILD (msbuild.exe) 尝试使用TeamCity 8部署SSDT项目时无效的文件名 - Invalid file names when trying to deploy SSDT project with TeamCity 8 TFS 构建服务器上的无头构建 .sqlproj 文件 - Headless build .sqlproj file on TFS build server 在SSDT SQLPROJ中有条件地构建部署后 - Conditionally build Post-Deploy in SSDT SQLPROJ TeamCity / .sqlproj通过MSBuild构建 - 失败 - TeamCity/.sqlproj build via MSBuild — FAILED 如何在“无头”构建服务器上构建SSDT项目? - How to build SSDT project on a “headless” build server? 在构建sqlproj时指定连接字符串 - Specify a connection string when building sqlproj TeamCity在构建项目时包含dll作为参考 - TeamCity includes dll as reference when building project 在构建服务器上构建时,缺少包含.NetStandard项目 - Missing include for .NetStandard project when building on build server 使用Microsoft.Build.Evaluation发布数据库项目(.sqlproj) - Using Microsoft.Build.Evaluation to publish a database project (.sqlproj)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM