Error while connecting to Database Server from SQL Server Management Studio

本秂侑毒 提交于 2021-01-28 20:06:51

问题


Recently, while trying to connect to any SQL Server Database from SQL Server Management Studio, I am getting an error - Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)

I tried updating to the latest version of SQL Server Management Studio but there is no change.

The full error stack is as below:

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

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)

Any idea why this error is happening?


回答1:


What helped in my case... (version 17.9.1)

I have checked file:

C:\Users\<user>\AppData\Roaming\Microsoft\AppEnv\14.0\ActivityLog.xml

In thre I have found the information that directory:

C:\Users\<user>\Documents\SQL Server Management Studio

Has not been found. I have created it manually and... SSMS started working.

Yeah I know... It sounds crazy.




回答2:


@Marek Malczewski is right, thank you sir!

I too looked at the log files and fixed it the same way, here is a screenshot for your confirmation.




回答3:


Install .NET 4.8. I've had exactly the same issue and it worked for me.



来源:https://stackoverflow.com/questions/57588926/error-while-connecting-to-database-server-from-sql-server-management-studio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!