无法连接到 VSTS LocalDB 实例

Unable to connect to VSTS LocalDB instance

我们 运行 在 Visual Studio 在线构建任务中进行集成测试,针对 运行 在托管 VSTS 构建代理上的 LocalDB 实例执行它们。

我们有一个任务通过执行这些命令来启动 LocalDB:

sqllocaldb create MSSQLLocalDB
sqllocaldb start MSSQLLocalDB
sqllocaldb info MSSQLLocalDB

当它 运行s:

时这似乎没问题
LocalDB instance "MSSQLLocalDB" started.
Name:               MSSQLLocalDB
Version:            13.1.4001.0
Owner:              factoryvm-az442\VssAdministrator
Auto-create:        Yes
State:              Running

集成测试项目的连接字符串如下所示:

Server=(localdb)\MSSQLLocalDB;Database=MyDatabase;Trusted_Connection=True;MultipleActiveResultSets=true

这已经工作了一年多了,但在过去的几天里,我们在尝试 运行 测试时看到了这一点:

Login failed for user 'factoryvm-az442\VssAdministrator'

既然用了Trusted_Connection,不知道为什么登不上去。我也尝试删除它。我还尝试从 sqllocaldb info MSSQLLocalDB 的输出中解析名为管道名称的实例,并在连接字符串中使用它,例如Server=np:\.\pipe\LOCALDB#1579B709\tsql\query;Database=MyDatabase,但后来我得到:

A connection was successfully established with the server, but then an error occurred during the login process.
(provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)

知道我们怎样才能再次获得这个 运行ning 吗?

注意:请注意这与#不同,因为我没有无效的连接字符串并且我没有使用IntegratedSecurity

我也打开了一个 GitHub issue,Microsoft 的人回复说他们更新了 VSTS 代理映像 - 这似乎已经解决了问题。