在 VS2019 中安装任何扩展时出现 NullReferenceException [英] NullReferenceException when installing any Extension in VS2019

查看:48
本文介绍了在 VS2019 中安装任何扩展时出现 NullReferenceException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里发布了完全相同的问题:尝试安装扩展VS2019 导致 NullReferenceException

I got the exact same problem posted here: Attempting to Install an extension to VS2019 results in a NullReferenceException

同样的错误,同样的日志.但由于我无法发表评论也无法回答,而且这个问题目前还没有得到解答,所以我再问一次.

Same error, same log. But since I cannot comment nor answer and the question has not been answered as of yet, I'm asking again.

我正在使用 VS2019 社区,但我曾经使用过 VS2017 Enterprise.(学生证)

I am using VS2019 Community, but I had VS2017 Enterprise at one point. (student license)

到目前为止我尝试安装的每个扩展都导致了这个错误.例如实时共享"、打开命令行"、Visual Studio 的 Github 扩展"、Markdown 编辑器".

Every single extension I tried to install so far has led to this error. For example "Live Share", "Open Command Line", "Github Extension for Visual Studio", "Markdown Editor".

我相信它是从 Live Share 开始的,当时突然无故无法安装更新.我猜这甚至在 VS2017 中又回来了.但我想不起来,我只是假设.使用新安装的 VS2019,我无法通过应用内扩展功能安装任何扩展,也无法通过浏览器下载然后尝试打开它.

I believe it started with Live Share when suddenly an update wouldn't install for no reason. I guess that was back with VS2017 even. But I cannot recall, I just assume. With the newly installed VS2019 I was never able to install any extension via the in-app Extension feature, nor by downloading with browser and then trying to open it.

我尝试过的:

0) Perry Qian-MSFT 的每一个建议

0) Every suggestion by Perry Qian-MSFT

1) 修复 Visual Studio 2019

1) Repairing Visual Studio 2019

2) 重新安装 Visual Studio 2019

2) Reinstalling Visual Studio 2019

3) 卸载Live Share"

3) Uninstalling "Live Share"

4) 删除各种文件夹或其内容:

4) Deleting various Folders or contents thereof:

  • C:\Users\Admin\AppData\Local\Microsoft\VisualStudio
  • C:\Program Files (x86)\Microsoft Visual Studio\2017(试图摆脱任何残余)
  • C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions
  • C:\Users\Admin\AppData\Local\Microsoft\VisualStudio
  • C:\Program Files (x86)\Microsoft Visual Studio\2017 (trying to get rid of any remnants)
  • C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions

接下来,我将尽可能多地卸载:VS2019 和安装程序,并尝试查看剩下的内容,还有哪些内容会导致 a*** 如此痛苦.

Next I'll deinstall as much as possible: VS2019 and Installer and try to see what's left, what could have remained that causes such pain in the a***.

但是由于我的互联网会在一段时间后忙于重新安装,所以现在这个问题出现了.

But since my internet will be busy with reinstalling afterwards for a while this question goes up now.

Update1:​​安装程序在卸载时遇到了一些问题.通过 Windows 软件管理卸载失败并出现错误,但它仍从列表中删除.现在我已经删除了该文件夹,并将尝试重新安装安装程序.我不知道为什么我在把它全部扔掉之前没有尝试过.

Update1: The installer made some problems getting uninstalled. Deinstallation via Windows Software Management failed with an error but it was still removed from the list. Now I've deleted the folder and will try and reinstall the installer. I don't know why I didn't try that before throwing it all over board.

Update2:我决定从没有任何工作负载的简单准系统 VS2019 版本开始.但它仍然不起作用.所以回到扔掉所有东西并寻找剩下的东西.

Update2: I decided to start with a simple barebones VS2019 version without any workloads. But it still doesn't work. So back to throwing everything out and looking for the remainder.

Update3:我现在尝试删除各种文件夹,然后重新启动并再次尝试重新安装准系统 VS 2019 社区.还是一样的错误.这是一个列表:

Update3: I now tried to delete various folders then reboot and tried to reinstall a barebone VS 2019 Community again. Still same error. Here's a list:

  • C:\Program Files (x86)\Microsoft Visual Studio Tools for Unity
  • C:\Program Files (x86)\NuGet
  • C:\Program Files (x86)\MSBuild(.\Microsoft\Windows Workflow Foundation 除外)
  • C:\Users\Admin\AppData\Local\Microsoft\VisualStudio 服务
  • C:\Users\Admin\AppData\Local\Microsoft\VisualStudio\Packages
  • C:\Users\Admin\AppData\Roaming\Microsoft\Microsoft Visual Studio
  • C:\Users\Admin\AppData\Roaming\Microsoft\VisualStudio
  • C:\Users\Admin\AppData\Roaming\Visual Studio 设置
  • C:\Users\Admin\AppData\Roaming\vs_installershell
  • C:\Users\Admin\AppData\Roaming\vs-report-problem
  • C:\Users\Admin\Documents\Visual Studio 2013
  • C:\Users\Admin\Documents\Visual Studio 2017
  • C:\Users\Admin\Documents\Visual Studio 2019

奇怪的是,我的个人设置仍然存在.所以这些将是我的下一个目标.但是它们存储在哪里?有什么指点吗?

Oddly enough my personal settings are still persistent. So these will be my next target. But where are they stored? Any pointers?

Update4:好像设置存储在云中,嗯.我做了一个本地备份并尝试重置它们,导致另一个错误.

Update4: Seems like settings are stored in a cloud, hm. I made a local backup and tried to reset them resulting in yet another error.

Your settings were reset, but there were some errors.

Error 1:  An error occurred while importing settings for 'Product Updates' [code 5396].

这个产品更新"是罪魁祸首吗?

Was this 'Product Updates' Setting the culprit?

更新 5:重置设置似乎根本没有完成任何事情.

Update5: The settings reset didn't seem to accomplish anything at all.

Update6:所以,我已经退出了 VS,再次重新安装了 VS2019,这次似乎设置实际上被重置了.仍然没有运气.这真是令人沮丧.

Update6: So, I've signed out of VS, reinstalled VS2019 again and this time it seems like settings were actually reset. Still no luck. This is getting really frustrating.

就是这样.我受够了.除了重新安装 Windows 10,我不知道现在有什么帮助.也许有一些注册表错误?我在这里迷路了.

That's it. I'm done. Apart from reinstalling Windows 10 I have no clue what could help now. Maybe there was some registry error? I am lost here.

推荐答案

感谢 @dxiv 让我知道 InstallCleanup.exe.

Thanks to @dxiv who made me aware of the InstallCleanup.exe.

我不知道除了我所做的之外,该工具还做了什么,而且我一开始也无法判断出了什么问题.但那件事确实有帮助!

I don't know what that tool does additionally to what I did and I cannot tell what was wrong in the first place. But that thing actually helped!

再次感谢!

这篇关于在 VS2019 中安装任何扩展时出现 NullReferenceException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆