Update database feature not working in Publish Web dialog in Visual Studio 2012

╄→尐↘猪︶ㄣ 提交于 2019-12-07 04:06:53

问题


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 deployment task failed. (Could not generate deployment script. Unable to connect to target server. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXECUTING_METHOD.)

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

Update

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?


回答1:


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.



来源:https://stackoverflow.com/questions/12201606/update-database-feature-not-working-in-publish-web-dialog-in-visual-studio-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!