托管的 VS2017 代理构建 master.dacpac 不存在 [英] Hosted VS2017 agent build master.dacpac does not exist

查看:12
本文介绍了托管的 VS2017 代理构建 master.dacpac 不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 VS2017 Professional 创建的解决方案包含一个引用主数据库的 SQL Server 数据库项目.当使用托管 VS2017 代理在 Visual Studio Team Services 中构建我的解决方案时,我收到以下错误:

My solution created with VS2017 Professional contains an SQL Server Database Project that references the master database. When using the Hosted VS2017 agent to build my solution in Visual Studio Team Services I'm getting the errors below:

2017-07-14T12:44:17.8387743Z ##[错误]C:Program Files (x86)Microsoft视觉的Studio2017EnterpriseMSBuildMicrosoftVisualStudiov15.0SSDTMicrosoft.Data.Tools.Schema.SqlTask​​s.targets(559,5):错误 SQL72027:文件C:Program Files (x86)Microsoft VisualStudio2017ProfessionalCommon7IDEExtensionsMicrosoftSQLDBExtensionsSqlServer110SqlSchemasmaster.dacpac"不存在.2017-07-14T12:44:17.8397816Z C:Program 文件(x86)微软视觉Studio2017EnterpriseMSBuildMicrosoftVisualStudiov15.0SSDTMicrosoft.Data.Tools.Schema.SqlTask​​s.targets(559,5):构建错误 SQL72027:文件C:Program Files (x86)Microsoft VisualStudio2017ProfessionalCommon7IDEExtensionsMicrosoftSQLDBExtensionsSqlServer110SqlSchemasmaster.dacpac"不存在.[d:a3sMainItAsset.DatabaseItAsset.Database.sqlproj]

2017-07-14T12:44:17.8387743Z ##[error]C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuildMicrosoftVisualStudiov15.0SSDTMicrosoft.Data.Tools.Schema.SqlTasks.targets(559,5): Error SQL72027: File "C:Program Files (x86)Microsoft Visual Studio2017ProfessionalCommon7IDEExtensionsMicrosoftSQLDBExtensionsSqlServer110SqlSchemasmaster.dacpac" does not exist. 2017-07-14T12:44:17.8397816Z C:Program Files (x86)Microsoft Visual Studio2017EnterpriseMSBuildMicrosoftVisualStudiov15.0SSDTMicrosoft.Data.Tools.Schema.SqlTasks.targets(559,5): Build error SQL72027: File "C:Program Files (x86)Microsoft Visual Studio2017ProfessionalCommon7IDEExtensionsMicrosoftSQLDBExtensionsSqlServer110SqlSchemasmaster.dacpac" does not exist. [d:a3sMainItAsset.DatabaseItAsset.Database.sqlproj]

如何解决这个问题并让我的解决方案在 VSTS 中构建?

How can I fix this and get my solution to build in VSTS?

推荐答案

我只是在多开发人员的情况下对此有所了解.这似乎发生在 VS2017 SSDT 项目中,其中签入代码的开发人员最初将 Visual Studio 安装在与您不同的路径或 Visual Studio 的另一个实例中.例如,如果开发者 A 安装到 C: 上的默认值,但开发者 B 将他的 VS2017 安装到 E: 驱动器,则创建对 Master 的引用的人将工作,其他人将找不到 dacpac 文件.

I just got bit by this in a multi-developer situation. It seems to happen in VS2017 SSDT projects where the developer who checked in the code originally had their installation of Visual Studio in a different path than you, or another instance of Visual Studio. For example if developer A installed to defaults on C: but developer B installed his VS2017 to E: drive, whoever creates the reference to Master will work, the other will not find the dacpac file.

查看 .sqlproj 文件,您可能会发现对 Master 数据库的引用:

Looking in the .sqlproj file, you'll likely find this reference to the Master database:

 <ArtifactReference Include="C:Program Files (x86)Microsoft Visual Studio2017CommunityCommon7IDEExtensionsMicrosoftSQLDBExtensionsSqlServer130SqlSchemasmaster.dacpac">
  <HintPath>$(DacPacRootPath)ExtensionsMicrosoftSQLDBExtensionsSqlServer130SqlSchemasmaster.dacpac</HintPath>

注意:<HintPath> 是正确的,但是Include=" 是硬编码的路径.看来提示路径没有正常遵循应该是.要解决您的问题,请尝试将 HintPath 元素的内容复制到 Include 属性.保持 HintPath 不变.

Note: the <HintPath> is correct, but the Include=" is a hard coded path. It seems that the hint path is not followed as it normally should be. To fix your problem, try copying the contents of the HintPath element to the Include attribute. Leave the HintPath as it is.

<ArtifactReference Include="$(DacPacRootPath)ExtensionsMicrosoftSQLDBExtensionsSqlServer130SqlSchemasmaster.dacpac">

这篇关于托管的 VS2017 代理构建 master.dacpac 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆