Error: The reference to external elements from the source named 'master.dacpac' could not be resolved
Error: The reference to external elements from the source named 'master.dacpac' could not be resolved
我正在 windows 机器上使用 sqlpackage 构建数据库 dacpac。该项目包含对 master.dacpac
的引用
我将 dacpac 移动到 linux 机器(mssql-server-linux
docker 图像)并恢复数据库。
部署-database.sh
# publish dacpac using sqlpackage
./sqlpackage/sqlpackage /Action:Publish /sf:"/MyDb.dacpac" /tu:sa /tp:Password1 /tdn:MyDb /tsn:localhost
错误:
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.
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图像中,但出现同样的错误。
如何在引用了 master.dacpac 的 linux 环境中恢复 dapac?
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
文件在当前工作目录中。由于您的 MyDb.dacpac
文件存在于根目录中,因此将 master.dacpac
文件复制到那里并在根目录的上下文中执行 sqlpackage
命令。
下面的示例指定了对 sqlpackage
的绝对引用(如果它不在您的路径中)和对您的用户 dacpac 的相对引用(尽管绝对引用也可以)。
cd /
/sqlpackage/sqlpackage /Action:Publish /sf:"MyDb.dacpac" /tu:sa /tp:Password1 /tdn:MyDb /tsn:localhost
我遇到了类似的问题,我的解决方案是将 dacpac 文件重命名为大写(例如:MASTER.DACPAC
),这对我有用,并将包含 dacpac 文件的目录设为工作目录。
我正在 windows 机器上使用 sqlpackage 构建数据库 dacpac。该项目包含对 master.dacpac
我将 dacpac 移动到 linux 机器(mssql-server-linux
docker 图像)并恢复数据库。
部署-database.sh
# publish dacpac using sqlpackage
./sqlpackage/sqlpackage /Action:Publish /sf:"/MyDb.dacpac" /tu:sa /tp:Password1 /tdn:MyDb /tsn:localhost
错误:
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.
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图像中,但出现同样的错误。
如何在引用了 master.dacpac 的 linux 环境中恢复 dapac?
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
文件在当前工作目录中。由于您的 MyDb.dacpac
文件存在于根目录中,因此将 master.dacpac
文件复制到那里并在根目录的上下文中执行 sqlpackage
命令。
下面的示例指定了对 sqlpackage
的绝对引用(如果它不在您的路径中)和对您的用户 dacpac 的相对引用(尽管绝对引用也可以)。
cd /
/sqlpackage/sqlpackage /Action:Publish /sf:"MyDb.dacpac" /tu:sa /tp:Password1 /tdn:MyDb /tsn:localhost
我遇到了类似的问题,我的解决方案是将 dacpac 文件重命名为大写(例如:MASTER.DACPAC
),这对我有用,并将包含 dacpac 文件的目录设为工作目录。