更新数据库功能在Visual Studio 2012中的“发布Web"对话框中不起作用 [英] Update database feature not working in Publish Web dialog in Visual Studio 2012

查看:123
本文介绍了更新数据库功能在Visual Studio 2012中的“发布Web"对话框中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2012下开发ASP.NET Web窗体应用程序.我正在使用Web Deploy和Publish Web对话框进行应用程序部署.我正在尝试使用更新数据库"功能来部署数据库架构.我输入了一个指向远程SQL Server的连接字符串.如果我单击测试连接"按钮,Visual Studio表示测试连接成功.

I'm developing an ASP.NET Web Forms application under Visual Studio 2012. I'm using Web Deploy and Publish Web dialog for application deploy. I'm trying to deploy a database schema using the Update database feature. I entered a connection string pointing to remote SQL Server. If I click the "Test connection" button Visual Studio says test connection is succeeded.

然后我转到预览"选项卡,然后单击预览数据库"链接.

Then I go to Preview tab and click the Preview database link.

在打开的窗口中,我收到消息

And in the opened window I have the message

Web部署任务失败.(无法生成部署脚本.无法连接到目标服务器.了解更多信息: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXECUTING_METHOD .)

其他项目文件已正常部署.我可以使用SQL Server管理服务连接到SQL Server.但是,为什么无法更新数据库?我试图禁用服务器防火墙-运气不好.

Other project files are deployed normally. I'm able to connect to SQL Server using SQL Server Management Service. But why the database could not be updated? I tried to disable server firewall - with no luck.

  • Visual Studio Professional 2012
  • SQL Server 2012
  • Web Deploy 3.0

更新

一切正常.但是Windows身份验证对于SSMS可以正常工作,并且我想使用它,因为我仅从公司域内的计算机进行部署.dbDacFx不能与Windows身份验证一起使用吗?

All works fine if I use SQL Server Authentication with the sa login instead of Windows Authentication in connection string for DatabaseEntitiesRaw. But Windows Authentication works fine for SSMS, and I want to use it since I'm deploying only from computers within my company's domain. Is it true that dbDacFx doesn't work with Windows Authentication?

推荐答案

部署脚本从AUTHORITY \ LOCAL SERVICE用户运行,因此您必须将此用户添加到SQL Server.不要再为用户添加db_owner角色.

Deploy script runs from AUTHORITY\LOCAL SERVICE user, so you have to add this user to SQL server. Do not foget to add db_owner role for the user.

这篇关于更新数据库功能在Visual Studio 2012中的“发布Web"对话框中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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