dacpac - CLR 程序集引用路径问题

dacpac - CLR assembly reference path issue

以下是我的数据库项目中的确切场景,我在其中创建 dacpac 以在目标 SQL 实例上部署数据库:

– 当我尝试 运行 sqlpackage.exe 在我的环境中部署 dacpac(在 TFS 构建过程中生成)时,我收到一条错误消息 –

*** No file was supplied for reference XXXX.XXXX.XXXX.dll; deployment might fail. When C:\Temp\Dacpac_testing\XXX.XXXXX.XXXX.dacpac was created, the original referenced file was located C:\BUILDS\XXXX\XXXX\SRC\XXXXXXXX\ASSEMBLIES\XXXX.XXXX.XXXX.dll

我如何创建一个 dacpac 来引用部署环境中 CLR 程序集的路径(而不是在构建 dacpac 时使用的路径)

如有任何帮助,我们将不胜感激。

抱歉,我现在只选择了这个话题,但我遇到了类似的问题。 打开 Sql 服务器项目中的引用,转到您引用的 dll 右键单击​​和 select 属性。

更改以下设置: 生成 Sql 脚本:True 模型感知:True

Select clr 代码要求的相关权限集。

我能够通过在部署 dacpac 的机器上包含 SSDT 项目构建的 bin/output 文件夹中的所有文件来解决这个问题。此文件夹包含所有引用的 DLL 和 DAPAC。我还在构建输出中包含 publish.xml 文件和一些示例 SQLPackage cmd 文件,以便于部署。

我在 SQL Server Data Tools 论坛中从 Richard Gavel 的 post 中找到了答案。 https://social.msdn.microsoft.com/Forums/sqlserver/en-US/aba60b70-396f-4624-890c-015c1f2d68f7/dacpac-dependencies-for-sqlpackageexe?forum=ssdt

I don't know if this helps but I was having trouble running SqlPackage /Action:Script between my compiled DACPAC and an extracted DACPAC and got a similar error (An error occurred while adding references). I resolved it by copying all the DACPACS from the \bin\debug directory of my DACPAC (it has about references to 15 other database projects plus master and msdb). After that, it worked. So it seems that in looking for references, it will check the directory first (I don't know if it was looking specifically at the current directory or the one the root DACPAC was in because those were one and the same).