【问题标题】:SSMS 18.1 throwing errors on startup with UI elements missingSSMS 18.1 在启动时抛出错误,缺少 UI 元素
【发布时间】:2020-12-23 23:12:34
【问题描述】:

自从我将 Windows 升级到 2019 年 5 月 (1903) 版本后,SQL Server Management Studio 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 元素:

我已采取的步骤:

  1. 已卸载 SSMS 18.1 和所有相关工具和包(包括 C++ 可再发行组件、VS 2017 shell 和工具、数据工具包等)
  2. 已卸载 Visual Studio 2019 以及所有相关工具和包。这主要是为了检查 VS 2019 和 SSMS 之间的冲突包/工具)
  3. 已删除 Microsoft 下 Local/Roaming 中与 Visual Studio 和 SSMS 相关的 AppData 条目,以尝试清除本地设置。
  4. 重启电脑,重新安装SSMS 18.1(最新版)

我已经采取了其他步骤并重复了这个过程几次 - 每次都好像有大量的支持包和组件丢失或放置不正确。我没有更改我机器上的任何驱动器号,据我所知,没有任何东西依赖于网络位置。

没有重装Windows,我很茫然。

更新:我尝试安装 SSMS 18.0,它可以 100% 正常工作。所以这是特定于 Windows 版本 1903 上的 18.1(10.0.18362 Build 18362)

【问题讨论】:

  • 你的杀毒软件在抢吗?
  • 我不这么认为,我只运行了默认的 Windows 保护 - 在我的最后一轮重复步骤中,我完全禁用了防火墙等。
  • 这对你一点帮助都没有,但我发现 SSMS 18.x 有很多问题,我已经回滚到 17.9.x。我在 18.x 中遇到的问题包括:使用鼠标更改选项卡时无法正确重绘窗口,以及尝试从 .bak 文件恢复数据库时出现硬挂起。您可能想去这里留下您的反馈:feedback.azure.com/forums/908035-sql-server

标签: sql-server ssms


【解决方案1】:

我的经历与弗拉德略有不同,所以我想分享一下,希望能帮助他人。在我的例子中,ActivityLog.xml 确实引用了一个文件 user.config 第 6 行。该文件有 5 行良好的数据,然后对文件的其余部分进行了垃圾处理。 user.config 位于此处:C:\Users\me\AppData\Local\Microsoft_Corporation\DefaultDomain_Url_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 时也不会删除此文件,因此修复或卸载/重新安装无法解决问题。

这是完整的相关错误消息,如果 Microsoft 有人可以解决此问题,那就太棒了!

<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>

【讨论】:

    【解决方案2】:

    TL;DR 以下是解决方案:听起来很荒谬,但在我创建了Documents\SQL Server Management Studio 文件夹后,错误消失了,丢失的 UI 元素又返回了。到目前为止它运行良好(手指交叉)。

    详情

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

    无论如何,我刚刚在日志最底部注意到的一件事是(我不知道你是否也有):

    Could not find file 'C:\Users\vs\Documents\SQL Server Management Studio'. System.IO.FileNotFoundException: Could not find file 'C:\Users\vs\Documents\SQL Server Management Studio'. File name: 'C:\Users\vs\Documents\SQL Server Management Studio' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) at System.IO.Directory.CreateDirectory(String path) at Microsoft.SqlServer.Management.SqlStudio.SetDefaultProjectOpenLocation() at Microsoft.SqlServer.Management.SqlStudio.SetupInitialShellSettings() at Microsoft.SqlServer.Management.SqlStudio.Initialize() at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)

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

    附:如果您认为它可能想将一些文件写入该文件夹,那您就错了。文件夹仍然是空的......它只是坐在那里。我喜欢认为它让 SSMS 感觉很舒服。 另外,如果它非常需要它,我无法告诉你它是如何创建文件夹失败的。当然它可以访问,特别是考虑到我在尝试使其工作时多次尝试以管理员权限运行它。

    【讨论】:

      猜你喜欢
      • 2013-11-26
      • 2021-12-21
      • 2017-07-13
      • 1970-01-01
      • 2016-12-23
      • 2016-06-15
      • 2020-06-26
      • 1970-01-01
      • 2015-11-25
      相关资源
      最近更新 更多