Visual Studio 2013 Publish Database to Azure

↘锁芯ラ 提交于 2019-12-01 13:58:33

问题


I have created a new "Database" project in Visual Studio 2013. I have set the Target platform to "Windows Azure SQL Database". The project is nearly empty, with the exception of one .sql file to create a Schema.

When I try to publish the project, it takes several minutes and ends with:

Creating publish preview... Failed to import target model [database_name]. Detailed message Unable to reconnect to database: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

I have tested the connection string, and it works.

What do I need to do to publish to Azure? Thanks.


回答1:


Like Hesham mentioned in the comments, I also had this issue with the new Basic tier of Azure SQL Database. Switching the tier to Standard S0 size fixed the issue. So if you're having issues with the Basic tier, try scaling up to publish, then scale back down when you're finished.




回答2:


Check this answer from MSDN forum, worked with me perfectly!

In order to change the command timeouts used in Visual Studio 2013 you will need to change the following registry setting:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\SQLDB\Database\QueryTimeoutSeconds

Source:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7e869f10-529b-41af-b54f-709a420308f6/publish-database-to-a-new-basic-scale-db-from-vs2013-times-out?forum=ssdsgetstarted




回答3:


I had experienced the same problem and was able to resolve it by changing the 'Connect Timout' value to 0 in the 'Publish Database' dialog.

  1. In the 'Target database connection:' field, click 'Edit...'.
  2. In 'Connection Properties' dialog, click 'Advanced...'.
  3. In the 'Initialization' section, set 'Connect Timeout' to 0.

Link to screencapture...I don't yet have enough points to publish an image. :)

My project had been taking 2-3 minutes before failing with the timeout. After the setting change, it successfully published within a minute.

I hope that helps.



来源:https://stackoverflow.com/questions/26070464/visual-studio-2013-publish-database-to-azure

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