尝试为 VS2019 安装扩展会导致 NullReferenceException [英] Attempting to Install an extension to VS2019 results in a NullReferenceException
问题描述
自 VS 2019 发布以来,我一直无法向其添加扩展.我最近更新到了 16.4.3 版,但在尝试添加扩展时仍然出现相同的错误.
I've not been able to add extensions to my VS 2019 since its release. I recently updated to Version 16.4.3 but I still get the same error when I try to add extensions.
我尝试执行以下操作,但仍然失败并显示上面的错误对话框.
I've tried to do the following but it still fails with an error dialog above.
- 从 Visual Studio 中的扩展管理器安装;
- 从 MarketPlace 下载扩展程序并双击安装;
- 在 VS 2019 Developer Command Prompt 管理模式下使用 VSIXInstaller.exe 命令行进行安装.
这是我从安装日志中得到的.
This is what I get from the install log.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Setup.Cache.Instance.get_SupportsExtensions()
at VSIXInstaller.SetupExtensions.GetLaunchableInstances(IQuery query)
at VSIXInstaller.SupportedSKUs.EnumerateIsolatedInstalls(Action`1 callback)
at VSIXInstaller.SupportedSKUs.AddInstalledLocationBasedSKUs(IntPtr userToken)
at VSIXInstaller.SupportedSKUs.InitializeSupportedSKUs(IntPtr userToken)
at VSIXInstaller.ExtensionService.InitializeSupportedSKUs(ICommandLineData cmdLineData, IntPtr duplicatedUserToken)
at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
at VSIXInstaller.App.Initialize()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
到目前为止我尝试安装的每个 VS2019 扩展都给了我这个错误.为 VS2017 安装扩展程序也不例外.
Every VS2019 extension I've tried to install so far has given me this error. Installing extensions to VS2017 is no different.
推荐答案
我遇到了同样的问题,这个解决方案解决了我的问题,虽然很长,但对我有用.
I had the same problem and this solution solved my problem, it is a long one, but worked for me.
Visual Studio 2019(社区版) - 无法安装/更新扩展
这篇关于尝试为 VS2019 安装扩展会导致 NullReferenceException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!