5

We are trying to set up automated deployment of our database project and need some help.

We are using VS2012, TFS 2012 and SQL server 2008 R2. We have a single solution file which contains all the projects. We would like to have the database project build and deploy at set intervals - say nightly.

I have created the publish profile which works, but when I schedule the build definition I get this error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets (1255): File "C:\Builds\1\projectName\Deploy Database\output\Binaries\Storage.SqlServer.dacpac" does not exist.

The build machine and deployment server is all set up correctly, as far as I can tell.

How can I fix this? We don't have a .dacpac file that I can see.

4

3 回答 3

1

检查构建日志和构建服务器上的输出目录(例如\project\bin\Debug 或\project\bin\Release)以查看项目是否正在构建。如果它没有被构建,那么检查解决方案的配置属性以确保为您的数据库项目检查了构建标志。

如果它正在构建但未输出,那么如果数据库项目上没有直接引用或依赖关系,则可能会发生这种情况。检查解决方案的项目依赖关系并确保检查数据库项目的依赖标志。

如果数据库项目正在按预期构建但仍未部署,则解决方案的配置属性中还有一个部署标志可以解决此问题。

于 2013-10-21T13:10:52.440 回答
0

“我们没有我能看到的 .dacpac 文件。” 猜测这就是为什么它会因为“文件”C:\Builds\1\projectName\Deploy Database\output\Binaries\Storage.SqlServer.dacpac“不存在而失败。”

大概你需要一个更早的任务(例如)a)从源代码管理中获取数据库定义,b)根据定义创建一个数据库,然后 c)你可以通过 sqlpackage 自动创建 .dacpac .exe(例如这里的博客演练

于 2013-05-03T15:15:39.690 回答
0

我今天刚碰到这个。我通过添加构建解决方案的构建任务来解决它。这在部署命令查找它的 bin 文件夹中生成了我的 dacpac 文件。

于 2015-06-23T21:15:31.057 回答