MSDeploy/WebDeploy-通过DacPac部署复合数据库项目 [英] MSDeploy/WebDeploy - Deploy Composite Database Project via DacPac

查看:123
本文介绍了MSDeploy/WebDeploy-通过DacPac部署复合数据库项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个数据库项目,该项目的视图连接到另一个数据库中的表.另一个数据库处于不同的解决方案中.直到我们从其他数据库添加了对DacPac的引用后,构建过程才失败.我认为这些视图被认为是复合数据库对象",因为它们引用的对象没有作为脚本包含在数据库中,而是在DacPac中引用.我们可以成功地将这个项目从VS部署到目标数据库.

We have a database project with views which join to tables in another database. The other database is in a different solution. This failed to build until we added a reference to a DacPac from the other database. I believe these views are considered "Composite Database Objects" because they reference objects not included as scripts in the database but rather referenced in the DacPac. We can successfully deploy this project from the VS to the target database.

现在,我们正在尝试通过MSDeploy自动化部署.过去,通过从清单创建包,我们已经成功地使用DacPacs部署了非复合数据库项目.例如:

Now we are trying to automate the deployment via MSDeploy. We have successfully deployed non-Composite database projects using DacPacs in the past by creating a package from a manifest. For example:

但是在这种情况下,部署失败并显示以下错误:

But in this case the deployment fails with the following error:

错误SQL0:对来自命名源的外部元素的引用 无法解析"Other.dacpac",因为没有这样的来源 已加载.警告SQL72025:没有提供文件供参考 other.dacpac;部署可能会失败.创建包后, 原始参考文件位于D:\ BUILDS \ 6 \ CORE SERVICES \ ACME DB (DEV2-DEPLOY)\ SOURCES \ ACME.SQLDEPLOY \ DACPACS \ Other.DACPAC.

Error SQL0: The reference to external elements from the source named 'Other.dacpac' could not be resolved, because no such source is loaded. Warning SQL72025: No file was supplied for reference Other.dacpac; deployment might fail. When package was created, the original referenced file was located D:\BUILDS\6\CORE SERVICES\ACME DB (DEV2-DEPLOY)\SOURCES\ACME.SQLDEPLOY\DACPACS\Other.DACPAC.

错误:添加引用时发生错误.部署无法 继续.错误计数:1.

Error: An error occurred while adding references. Deployment cannot continue. Error count: 1.

是否有技巧来确保引用的DacPac将其装入程序包并成功完成部署?

Is there a trick to make sure the referenced DacPac makes it into the package and the deployment completes successfully?

推荐答案

最后,我们不得不:

  • 解压缩DacPac
  • 将引用的DacPac的路径更改为相对路径
  • 重新计算校验和并更新
  • 重新压缩DacPac

不太理想,但是最后我们现在有了一个自动部署过程,用于DacPac引用DacPacs.

Not ideal, but in the end we now have an automated deployment process for DacPac referencing DacPacs.

这篇关于MSDeploy/WebDeploy-通过DacPac部署复合数据库项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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