错误:无法解析来自名为“ master.dacpac”的源中的外部元素 [英] Error: The reference to external elements from the source named 'master.dacpac' could not be resolved

查看:93
本文介绍了错误:无法解析来自名为“ master.dacpac”的源中的外部元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows机器上使用sqlpackage构建数据库dacpac。该项目包含对 master.dacpac

I am building a database dacpac using sqlpackage on a windows machine. The project contains a reference to master.dacpac

我将dacpac移至Linux机器( mssql-server-linux docker image)并还原数据库。

I take the move the dacpac to a linux machine (mssql-server-linux docker image) and restore the database.

deploy-database.sh

# publish dacpac using sqlpackage
./sqlpackage/sqlpackage /Action:Publish /sf:"/MyDb.dacpac" /tu:sa /tp:Password1 /tdn:MyDb /tsn:localhost

错误:


没有为引用master.dacpac提供文件;部署可能会失败。创建软件包时,原始引用文件为
,位于C:$(Windows机器路径)\MASTER.DACPAC。初始化
部署(失败)
生成部署计划时发生错误。部署无法继续。错误SQL0:无法解析来自名为 master.dacpac的源中
的外部元素的引用,因为没有加载
这样的源。警告SQL72025:没有为
参考master.dacpac提供文件;部署可能会失败。创建软件包
时,原始引用文件位于C:$(Windows计算机
路径)\MASTER.DACPAC。

No file was supplied for reference master.dacpac; deployment might fail. When package was created, the original referenced file was located C:$(windows machine path)\MASTER.DACPAC. Initializing deployment (Failed) An error occurred during deployment plan generation. Deployment cannot continue. Error SQL0: The reference to external elements from the source named 'master.dacpac' could not be resolved, because no such source is loaded. Warning SQL72025: No file was supplied for reference master.dacpac; deployment might fail. When package was created, the original referenced file was located C:$(windows machine path)\MASTER.DACPAC.

错误添加引用时发生。无法继续部署
。命令'/ bin / sh -c sh /deploy-database.sh'返回
非零代码:1

An error occurred while adding references. Deployment cannot continue. The command '/bin/sh -c sh /deploy-database.sh' returned a non-zero code: 1

我尝试将 master.dacpac 直接添加到项目中,并将其复制到docker映像中,但是会发生相同的错误。

I have tried adding master.dacpac to the project directly and also copying it to the docker image but the same error occurs.

如何在引用了master.dacpac的Linux环境中恢复dapac?

How can I restore a dapac in a linux environment that has a reference to master.dacpac?

推荐答案

I有一个类似的问题,我的解决方案是将dacpac文件重命名为大写(例如: MASTER.DACPAC ),该方法对我有用,并使用dacpac文件创建目录工作目录。

I had a similar issue, my solution was to rename the dacpac files UPPERCASE, (ex: MASTER.DACPAC) which worked for me, as well as making the directory with the dacpac files the working directory.

这篇关于错误:无法解析来自名为“ master.dacpac”的源中的外部元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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