SSMS 18.1 在启动时抛出错误且缺少 UI 元素

问题描述 投票:0回答:2

自从我将 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 下的本地/漫游中与 Visual Studio 和 SSMS 相关的 AppData 条目,以尝试清除本地设置。
  4. 重新启动计算机,并重新安装SSMS 18.1(最新版本)

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

没有重新安装Windows,我不知所措。

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

sql-server ssms
2个回答
2
投票

TL;DR 这是解决方案: 尽管听起来很荒谬,但在我创建

Documents\SQL Server Management Studio
文件夹后,错误消失了,并且返回了丢失的 UI 元素。到目前为止一切正常(祈祷)。

详情

过去几天我遇到了类似的问题,日志中出现很多“正在加载 UI 库”错误,并且在启动时和许多设备上弹出“程序包 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 感觉很舒服。 另外,我无法告诉您如果非常需要该文件夹,它是如何无法创建该文件夹的。当然它有访问权限,特别是考虑到我确实多次尝试使用管理员权限运行它,因为我试图让它工作。


2
投票

我的经历与 Vlad 略有不同,所以我想分享一下,希望能帮助其他人。

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 时,该文件也不会被删除,因此修复或卸载/重新安装无法解决问题。

这里是完整的相关错误消息,如果微软的人可以解决这个问题,那就太棒了!

<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>
© www.soinside.com 2019 - 2024. All rights reserved.