NullReferenceException when installing any Extension in VS2019

好久不见. 提交于 2020-06-29 04:48:06

问题


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.

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

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

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.

What I've tried:

0) Every suggestion by Perry Qian-MSFT

1) Repairing Visual Studio 2019

2) Reinstalling Visual Studio 2019

3) Uninstalling "Live Share"

4) Deleting various Folders or contents thereof:

  • 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

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: 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: 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: 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 (except for .\Microsoft\Windows Workflow Foundation)
  • C:\Users\Admin\AppData\Local\Microsoft\VisualStudio Services
  • 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 Setup
  • 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: 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?

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

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.

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.


回答1:


Thanks to @dvix 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!

Thanks again!



来源:https://stackoverflow.com/questions/61827484/nullreferenceexception-when-installing-any-extension-in-vs2019

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!