从 SQL Server Management Studio 连接到数据库服务器时出错

Sil*_*ohn 2 sql-server ssms

最近,在尝试从 SQL Server Management Studio 连接到任何 SQL Server 数据库时,出现错误 - Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)

我尝试更新到最新版本的 SQL Server Management Studio,但没有任何变化。

完整的错误堆栈如下:

===================================

Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.ServiceProvider.GetService[T](IServiceProvider serviceProvider, Boolean throwIfNotFound)
   at Microsoft.SqlServer.Management.SqlStudio.Explorer.NavigationService.Initialize()
   at Microsoft.SqlServer.Management.SqlStudio.Explorer.NavigationService.GetView(String urnPath)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.<GetColumnsFromNavigationService>d__11.MoveNext()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.AddFields(List`1 list, IEnumerable`1 fields, IDictionary`2 allValidFields, AddFieldsFlags flags)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.GetParentFields(INodeInformation source, Dictionary`2& allValidColumns)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItemWithQuery(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, String urnQuery, Boolean registerBuilder, Boolean registerBuiltItems)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.BuildDynamicItem(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItemBuilder.Build(IList`1 nodes, INodeInformation source, INavigableItem sourceItem, IFilterProvider filter)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.RequestChildren(IGetChildrenRequest request)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ExplorerHierarchyNode.BuildChildren(WaitHandle quitEvent)
Run Code Online (Sandbox Code Playgroud)

知道为什么会发生此错误吗?

小智 8

在我的情况下有什么帮助...(版本 17.9.1)

我检查了文件:

C:\Users\<user>\AppData\Roaming\Microsoft\AppEnv\14.0\ActivityLog.xml
Run Code Online (Sandbox Code Playgroud)

在那里我找到了目录的信息:

C:\Users\<user>\Documents\SQL Server Management Studio
Run Code Online (Sandbox Code Playgroud)

没有找到。我已经手动创建了它...... SSMS 开始工作。

是的,我知道……这听起来很疯狂。