Entity framework core 快速启动错误-对本地SQL Server使用EF迁移并不断断开数据库连接

Entity framework core 快速启动错误-对本地SQL Server使用EF迁移并不断断开数据库连接,entity-framework-core,identityserver4,entity-framework-migrations,Entity Framework Core,Identityserver4,Entity Framework Migrations,我正在遵循IdentityServer4 quickstart并尝试将内存中的数据迁移到本地SQL Server(而不是VS附带的SQL express或LocalDB)。我的连接字符串是: @“服务器=localhost,1434;数据库=myid;用户id=tester\u 1;密码=tester\u 1;可信连接=yes;” 当我启动IdentityServer时,它会创建enpty db、MyID,然后抛出一个包含2个内部异常的异常: 内部异常1: SqlException:已成功与服务

我正在遵循IdentityServer4 quickstart并尝试将内存中的数据迁移到本地SQL Server(而不是VS附带的SQL express或LocalDB)。我的连接字符串是:

@“服务器=localhost,1434;数据库=myid;用户id=tester\u 1;密码=tester\u 1;可信连接=yes;”

当我启动IdentityServer时,它会创建enpty db、MyID,然后抛出一个包含2个内部异常的异常:

内部异常1: SqlException:已成功与服务器建立连接,但在预登录握手期间发生错误。(提供程序:TCP提供程序,错误:0-主机中的软件中止了已建立的连接。)

内部例外2: Win32Exception:主机中的软件中止了已建立的连接


谁能告诉我这里发生了什么事?为什么工作连接总是断开?

localhost,1434看起来是错误的,您不需要提供端口1434,也不应该使用commma,在这种情况下,它应该是冒号

我通常用于本地开发:

server=.;Database=ASPIdentity;Trusted_Connection=True;
点表示本地主机,如果使用sqlexpress,则连接字符串将变为

server=.\\sqlexpress;Database=ASPIdentity;Trusted_Connection=True;