Sql server SSMS 18.1启动时抛出错误,缺少UI元素

Sql server SSMS 18.1启动时抛出错误,缺少UI元素,sql-server,ssms,Sql Server,Ssms,自从我将Windows升级到2019年5月1903版以来,SQLServerManagementStudio 18.1一直在启动时抛出错误。当我使用-log选项启动它时,会报告数百个错误,如: <type>Error</type> <source>VisualStudio</source> <description>Loading UI library</description> <guid>{198E76C1-

自从我将Windows升级到2019年5月1903版以来,SQLServerManagementStudio 18.1一直在启动时抛出错误。当我使用-log选项启动它时,会报告数百个错误,如:

<type>Error</type>
<source>VisualStudio</source>
<description>Loading UI library</description>
<guid>{198E76C1-34C0-424D-9957-B3EBD80265FB}</guid>
<hr>800a006f</hr> 
...
<type>Error</type>
<source>VisualStudio</source>
<description>Error loading UI library for package (null).HrLoadNativeUILibrary failed with 0x800a006f.</description>
...
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Management Studio Update Checker]Source: ...</description>
<guid>{A370BC08-51DD-4F09-8386-8F31E8704796}</guid>
<hr>80131534</hr>
...
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Management Studio Update Checker](null)</description>
<guid>{A370BC08-51DD-4F09-8386-8F31E8704796}</guid>
<hr>80131534</hr>
当SSMS最终加载时,我以前访问过的数据库列表将消失,并且缺少如下UI元素:

我已采取的步骤:

未安装的SSM 18.1和所有相关的工具和包,包括C++ +可再分布、VS 2017外壳和工具、数据工具包等 已卸载Visual Studio 2019以及所有相关工具和软件包。这主要是为了检查VS 2019和SSM之间冲突的软件包/工具是否正常 已删除Microsoft下本地/漫游中与Visual Studio和SSMS相关的AppData条目,以尝试清除本地设置。 重新启动计算机,并重新安装SSMS 18.1最新版本 我已经采取了其他步骤,并多次重复这个过程——每次都好像有大量支持包和程序集丢失或放置不正确。我没有在我的机器上更改任何驱动器号,据我所知,没有任何东西依赖于网络位置

如果不重新安装Windows,我就不知所措了

更新:我试着安装SSMS18.0,它100%正常工作。因此,这是针对Windows版本1903 10.0.18362上的18.1构建18362的TL;DR这里是解决方案:听起来很可笑,在我创建了Documents\SQL Server Management Studio文件夹之后,错误消失了,丢失的UI元素返回了。到目前为止,一切都很顺利

细节

在过去的几天里,我遇到了一个类似的问题,日志中出现了很多加载UI库的错误,并且在启动时以及在许多用户操作(例如打开连接对话框,甚至是“帮助”菜单中的“关于窗口”)中弹出了一个包Microsoft.SqlServer.Management.SqlStudio未能正确加载错误消息

总之,我在日志的最底部注意到一件事,我不知道你是否也有:

找不到文件“C:\Users\vs\Documents\SQL Server Management Studio”。System.IO.FileNotFoundException:找不到文件“C:\Users\vs\Documents\SQL Server Management Studio”。文件名:System.IO中的“C:\Users\vs\Documents\SQL Server Management Studio”。\uuu Error.WinIOErrorInt32 errorCode,System.IO.Directory中的字符串maybeFullPath.InternalCreateDirectoryString fullPath,字符串路径,Object dirSecurityObj,System.IO.Directory中的布尔checkHost.InternalCreateDirectoryHelperString路径,位于Microsoft.SqlServer.Management.SqlStudio.SetDefaultProjectOpenLocation的System.IO.Directory.CreateDirectoryString路径处的布尔checkHost位于Microsoft.SqlServer.Management.SqlStudio.SetupInitialShellSettings位于Microsoft.SqlServer.Management.SqlStudio.Initialize位于Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSiteIServiceProvider sp

现在,由于我没有主意修复/重新安装SSMS没有帮助,删除SSMS注册表项没有帮助,我也不打算重新安装Windows,我决定继续手动创建它试图访问的路径

另外,如果你认为它可能想把一些文件写到那个文件夹里,那你就错了。文件夹仍为空。。。它只是坐在那里。我喜欢认为这会让SSMS感到舒适。
此外,我无法告诉您,如果它非常需要创建文件夹,它是如何失败的。确保它具有访问权限,特别是考虑到我曾多次尝试使用管理员权限运行它,因为我试图使它正常工作。

我与Vlad有一点不同的经验,所以我想我应该分享一下,希望能帮助其他人。在我的例子中,ActivityLog.xml确实引用了一个文件user.config第6行。该文件有5行良好的数据,然后对文件的其余部分进行垃圾处理。user.config位于此处供我使用:C:\Users\me\AppData\Local\Microsoft\u Corporation\DefaultDomain\u Url\u 315jocyprgycyaf1bv5fxwi31zcufzj1\15.0.18183.0\user.config 15.0.18183是针对SSMS 18.3的,我还为SSMS 18.1安装了15.0.18131?不管怎样,15.0.18131文件夹都有一个有效的user.config,所以我只是用好的一个重写了坏的一个。重新启动SSMS 18.3,一切正常。我还怀疑这就是为什么Jeff Dalley能够在SSMS 18.1不起作用时使用SSMS 18.0的原因。可能是因为他的18.1 user.config是FUBAR,而他的18.0 user.config是干净的。卸载SSMS 18.x时也不会删除此文件,因此修复或卸载/重新安装不会解决此问题

这是完整的相关错误消息,如果有人从微软可以修复这一点,这将是可怕的

<entry>
<record>146</record>
<time>2019/10/16 13:51:21.206</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Management Studio Update Checker]Source: &apos;Microsoft.SqlServer.Management.UpdateChecker&apos; Description: The type initializer for &apos;Microsoft.SqlServer.Management.UpdateChecker.UI.DataPackageProfile&apos; threw an exception.&#x000D;&#x000A;System.TypeInitializationException: The type initializer for &apos;Microsoft.SqlServer.Management.UpdateChecker.UI.DataPackageProfile&apos; threw an exception. ---&gt; System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---&gt; System.Configuration.ConfigurationErrorsException: &apos;.&apos;, hexadecimal value 0x00, is an invalid character. Line 6, position 1. (C:\Users\me\AppData\Local\Microsoft_Corporation\DefaultDomain_Url_315jocyprgycyaf1bv5fxwi31zcufzj1\15.0.18183.0\user.config line 6) ---&gt; System.Xml.XmlException: &apos;.&apos;, hexadecimal value 0x00, is an invalid character. Line 6, position 1.&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(Exception e)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText(Int32&amp; startPos, Int32&amp; endPos, Int32&amp; outOrChars)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseElementContent()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Read()&#x000D;&#x000A;   at System.Xml.XmlTextReader.Read()&#x000D;&#x000A;   at System.Configuration.XmlUtil.StrictReadToNextElement(ExceptionAction action)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactories(XmlUtil xmlUtil)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()&#x000D;&#x000A;   at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at System.Configuration.ConfigurationManager.PrepareConfigSystem()&#x000D;&#x000A;   at System.Configuration.ConfigurationManager.GetSection(String sectionName)&#x000D;&#x000A;   at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)&#x000D;&#x000A;   at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()&#x000D;&#x000A;   at System.Diagnostics.DiagnosticsConfiguration.Initialize()&#x000D;&#x000A;   at System.Diagnostics.DiagnosticsConfiguration.get_Sources()&#x000D;&#x000A;   at System.Diagnostics.TraceSource.Initialize()&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.STraceSource.Initialize()&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.STraceSource..ctor(String name)&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.STraceSourceCollection.get_Item(String sourceName)&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.TraceContext.GetTraceContext(String eventSourceName, String eventContext)&#x000D;&#x000A;   at Microsoft.SqlServer.Management.UpdateChecker.UI.DataPackageProfile..cctor()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at Microsoft.SqlServer.Management.UpdateChecker.UI.DataPackageProfile.Initialize()&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---&gt; System.Configuration.ConfigurationErrorsException: &apos;.&apos;, hexadecimal value 0x00, is an invalid character. Line 6, position 1. (C:\Users\me\AppData\Local\Microsoft_Corporation\DefaultDomain_Url_315jocyprgycyaf1bv5fxwi31zcufzj1\15.0.18183.0\user.config line 6) ---&gt; System.Xml.XmlException: &apos;.&apos;, hexadecimal value 0x00, is an invalid character. Line 6, position 1.&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(Exception e)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText(Int32&amp; startPos, Int32&amp; endPos, Int32&amp; outOrChars)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseElementContent()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Read()&#x000D;&#x000A;   at System.Xml.XmlTextReader.Read()&#x000D;&#x000A;   at System.Configuration.XmlUtil.StrictReadToNextElement(ExceptionAction action)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactories(XmlUtil xmlUtil)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()&#x000D;&#x000A;   at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at System.Configuration.ConfigurationManager.PrepareConfigSystem()&#x000D;&#x000A;   at System.Configuration.ConfigurationManager.GetSection(String sectionName)&#x000D;&#x000A;   at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)&#x000D;&#x000A;   at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()&#x000D;&#x000A;   at System.Diagnostics.DiagnosticsConfiguration.Initialize()&#x000D;&#x000A;   at System.Diagnostics.DiagnosticsConfiguration.get_Sources()&#x000D;&#x000A;   at System.Diagnostics.TraceSource.Initialize()&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.STraceSource.Initialize()&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.STraceSource..ctor(String name)&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.STraceSourceCollection.get_Item(String sourceName)&#x000D;&#x000A;   at Microsoft.SqlServer.Diagnostics.STrace.TraceContext.GetTraceContext(String eventSourceName, String eventContext)&#x000D;&#x000A;   at Microsoft.SqlServer.Management.UpdateChecker.UI.DataPackageProfile..cctor()System.Configuration.ConfigurationErrorsException: &apos;.&apos;, hexadecimal value 0x00, is an invalid character. Line 6, position 1. (C:\Users\me\AppData\Local\Microsoft_Corporation\DefaultDomain_Url_315jocyprgycyaf1bv5fxwi31zcufzj1\15.0.18183.0\user.config line 6) ---&gt; System.Xml.XmlException: &apos;.&apos;, hexadecimal value 0x00, is an invalid character. Line 6, position 1.&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(Exception e)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText(Int32&amp; startPos, Int32&amp; endPos, Int32&amp; outOrChars)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseElementContent()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Read()&#x000D;&#x000A;   at System.Xml.XmlTextReader.Read()&#x000D;&#x000A;   at System.Configuration.XmlUtil.StrictReadToNextElement(ExceptionAction action)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactories(XmlUtil xmlUtil)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()&#x000D;&#x000A;   --- End of inner exception stack trace ---&#x000D;&#x000A;   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()&#x000D;&#x000A;   at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)System.Xml.XmlException: &apos;.&apos;, hexadecimal value 0x00, is an invalid character. Line 6, position 1.&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(Exception e)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText(Int32&amp; startPos, Int32&amp; endPos, Int32&amp; outOrChars)&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseText()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.ParseElementContent()&#x000D;&#x000A;   at System.Xml.XmlTextReaderImpl.Read()&#x000D;&#x000A;   at System.Xml.XmlTextReader.Read()&#x000D;&#x000A;   at System.Configuration.XmlUtil.StrictReadToNextElement(ExceptionAction action)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactoriesRecursive(XmlUtil xmlUtil, String parentConfigKey, Hashtable factoryList)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.ScanFactories(XmlUtil xmlUtil)&#x000D;&#x000A;   at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()</description>
<guid>{A370BC08-51DD-4F09-8386-8F31E8704796}</guid>
<hr>80131534</hr>
<errorinfo></errorinfo>

你的防病毒软件能抓住它吗?我不这么认为,我只有默认的windows保护在运行-在我重复的最后一轮步骤中,我完全禁用了防火墙等。这对你一点帮助都没有,但我发现SSMS 18.x是如此的有缺陷,我已经滚动了 回到17.9.x。我在18.x中遇到的问题包括:用鼠标更改选项卡时无法正确重新绘制窗口,以及尝试从.bak文件恢复数据库时出现硬挂起。您可能想在这里留下您的反馈: