【问题标题】:Package Manager getting error Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance包管理器出现错误由于启动用户实例的进程失败而无法生成 SQL Server 的用户实例
【发布时间】:2019-11-11 07:03:12
【问题描述】:

当我在 nuget 包管理器中使用 update-database 命令时。 得到 “由于启动用户实例的进程失败,无法生成 SQL Server 的用户实例。连接将被关闭。”

我检查 SQL Server 配置 2 检查SSMS登录 正常工作

更多详情请查看完整日志。

PM> update -database

update :术语“update”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。 在行:1 字符:1 +更新-数据库 +~~~~~~ + CategoryInfo : ObjectNotFound: (update:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

PM> 更新数据库 指定“-Verbose”标志以查看应用于目标数据库的 SQL 语句。 System.Data.SqlClient.SqlException (0x80131904):由于启动用户实例的进程失败,无法生成 SQL Server 的用户实例。连接将被关闭。 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,UInt32 waitForMultipleObjectsTimeout,布尔allowCreate,布尔onlyOneCheckConnection,DbConnectionOptions userOptions,DbConnectionInternal& 连接) 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject,TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 重试,DbConnectionOptions userOptions,DbConnectionInternal oldConnection,DbConnectionInternal& 连接) 在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection,DbConnectionFactory connectionFactory,TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 重试,DbConnectionOptions userOptions) 在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 重试) 在 System.Data.SqlClient.SqlConnection.Open() 在 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__36(DbConnection t,DbConnectionInterceptionContext c) 在 System.Data.Entity.Infrastructure.Interception.InternalDispatcher1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action2 操作,TInterceptionContext 拦截上下文,Action3 executing, Action3 执行) 在 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection 连接,DbInterceptionContext 拦截上下文) 在 System.Data.Entity.SqlServer.SqlProviderServices.c__DisplayClass33.b__32() 在 System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.c__DisplayClass1.b__0() 在 System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func1 operation) at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action1 行为) 在 System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection,Action1 act) at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable1 commandTimeout,DbConnection sqlConnection,字符串 createDatabaseScript) 在 System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection 连接,Nullable1 commandTimeout, StoreItemCollection storeItemCollection) at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable1 命令超时,StoreItemCollection storeItemCollection) 在 System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase() 在 System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection 连接) 在 System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(操作 mustSucceedToKeepDatabase) 在 System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists(操作 mustSucceedToKeepDatabase) 在 System.Data.Entity.Migrations.DbMigrator.Update(字符串 targetMigration) 在 System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(字符串 targetMigration) 在 System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore() 在 System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run() ClientConnectionId:1fc5ad95-2b73-4e43-bce3-ebee4805c3fe 错误号:15372,状态:1,类:14 由于启动用户实例的进程失败,无法生成 SQL Server 的用户实例。连接将被关闭。 下午>

【问题讨论】:

    标签: visual-studio-2017 nuget-package package-managers


    【解决方案1】:

    这对我有用

    删除了以下目录的内容:c:\Users\\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS。

    并运行命令

    PM> 更新数据库

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多