从Visual Studio 2013而非SQL Server Management Studio调用时SQL LocalDb自动实例启动失败 [英] SQL LocalDb Automatic Instance Startup Failure when called from Visual Studio 2013, but not SQL Server Management Studio
问题描述
每个MSDN文档: http://msdn.microsoft.com/zh-我们/library/hh510202.aspx
LocalDB支持两种实例:自动实例和命名实例.
我怀疑这与我的问题有关,所以我想知道是否有人知道如何自动创建这样的东西.如果我能引用这些文档,则用户计算机上安装的每个版本的LocalDB都存在一个LocalDB的自动实例."
I suspect this has something to do with my problem, so I am wondering if anyone knows how something like this gets automatically created. If I can quote from the docs, "One automatic instance of LocalDB exists for every version of LocalDB installed on the user’s computer."
以下是上述链接中相关部分的副本:
Here is a copy of the relevant section in the above link:
Localp的自动实例是公共的.它们是为用户自动创建和管理的,并且可以被任何应用程序使用. 每个版本的LocalDB都有一个自动的LocalDB实例 安装在用户计算机上.自动的LocalDB实例 提供无缝的实例管理.无需创建 实例;它只是工作.这样可以方便地安装应用程序 并迁移到另一台计算机.
Automatic instances of LocalDB are public. They are created and managed automatically for the user and can be used by any application. One automatic instance of LocalDB exists for every version of LocalDB installed on the user’s computer. Automatic instances of LocalDB provide seamless instance management. There is no need to create the instance; it just works. This allows for easy application installation and migration to a different computer.
不同版本的LocalDB将具有不同的实例命名约定:
Different versions of LocalDB will have different instance naming conventions:
SQL 2012 LocalDB = V11.0
SQL 2014 LocalDB = ProjectsV12
- 我见过其他人.
只要正在连接的应用程序的连接字符串指向正确的实例,一切都很好:
As long as the connecting app's connection string points to the correct instance, all is well:
(localdb)\V11.0
(localdb)\ProjectsV12
如果我尝试使用SQL Server Management Studio连接到实例(localdb)\ V11.0或(localdb)\ ProjectsV12,则我可以,已停止"的服务器自动启动" .
If I try to connect with SQL Server Management Studio to either instance (localdb)\V11.0 or (localdb)\ProjectsV12, I CAN, the "stopped" server "autostarts".
如果我将VS2013中的SQL Server实例设置为实例(localdb)\ V11.0或(localdb)\ ProjectsV12,则我无法,停止"的服务器无法启动".它会尝试启动,但会失败.
If I set the SQL Server instance in VS2013 to either instance (localdb)\V11.0 or (localdb)\ProjectsV12, I CANNOT, the "stopped" server "fails" to start. It attempts to start, but fails.
这是在实例error.log中找到的错误消息,指示了实例启动失败的原因.
Here is the error message found in the instance error.log indicating why the instance start failed.
014-12-19 15:12:14.09 Logon Error: 17828, Severity: 20, State: 3.
2014-12-19 15:12:14.09 Logon The prelogin packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library. [CLIENT: <named pipe>]
我可能在这里找到了线索:
I may have found a clue here:
在我的其中一台自动实例化的机器上,sqllocaldb命令输出以下内容:
On one of my machines where Automatic Instancing works, the sqllocaldb command outputs following:
C:\>sqllocaldb info v11.0
Name: v11.0
Version: 11.0.3000.0
Shared name:
Owner: AM\Z617699
Auto-create: Yes <-- Yes? - and I have no idea how this is set.
State: Stopped
Last start time: 12/18/2014 5:18:46 PM
Instance pipe name:
在我的其他机器之一上,自动实例化不起作用,sqllocaldb命令输出以下内容:
On one of my other machines where Automatic Instancing does NOT work, the sqllocaldb command outputs following:
C:\>sqllocaldb info v11.0
Name: v11.0
Version: 11.0.3000.0
Shared name:
Owner: AM\Z617699
Auto-create: No <-- No? - and I have no idea how this is set.
State: Stopped
Last start time: 12/18/2014 5:18:46 PM
Instance pipe name:
我花了几天的时间来寻找这个问题的答案.这是MSDN论坛帖子的链接,该帖子概述了我为解决此问题而采取的所有不成功的步骤:
I have spent days trying to find the answer to this question. Here is a link to an MSDN forum post that outlines all the unsuccessful steps I have taken to resolve this issue: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/83ad45d5-15c3-4463-bc0c-6c4899bf947e/localdb-visual-studio-2013-will-not-automatically-start-the-sql-2014-localdb-projectsv12-instance?forum=sqlexpress
解决方法是在启动VS2013之前手动启动实例.我只是想解决此问题,以便为所有开发人员提供一个自动实例"图像.
The workaround is to just start the instance manually before you start VS2013. I'm just trying to resolve this issue so I can get an "Automatic Instance" image for all our developers.
希望您知道他的回答. :-)
I hope you just know he answer. :-)
谢谢,戴夫
推荐答案
我遇到了同样的问题. 我通过从命令行删除并重新创建实例来解决它:
I had the same issue. I resolved it by deleting and recreating the instance from command line:
- 打开命令行
- 通过键入以下内容删除会话:sqllocaldb delete"v11.0"
- 使用以下方法重新创建实例:sqllocaldb create"v11.0"
新实例允许自动创建并解决问题.
The new instance allows auto creation, and solves the issue.
这篇关于从Visual Studio 2013而非SQL Server Management Studio调用时SQL LocalDb自动实例启动失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!