Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Cannot Modify - Restart Required

Tags:

I have been trying to update and modify my Visual Studio 2017 for 2 days now, but each time I run the Visual Studio Installer, I get this message:

"A restart is required. If needed, any remaining setup will resume after the restart."

Obviously I restarted about 10 times...

Any idea what I must delete where to get rid of any temp garbage that is hindering my attempts to modify my installation?

like image 778
onmyway Avatar asked Mar 17 '17 05:03

onmyway


2 Answers

I encountered the same issue while installing Visual Studio 2019. I tried the PowerShell script proposed by @onmyway, to no avail.

Naturally, as with any simple problem in Windows, the fix is to manually edit the Windows Registry 🙄

It appears the installation may leave some stale keys behind. Remove the following keys from the registry according to your platform:

32Bit: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\Setup\Reboot

64Bit: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\Setup\Reboot

This immediately fixed my installation, and Visual Studio 2019 was able to start without further rebooting. I cannot promise that this will fix the issue for VS2017 users, but I leave this here for future readers.

Credit goes to Matt Cavallari from this forum thread.

like image 75
alter_igel Avatar answered Sep 25 '22 10:09

alter_igel


I eventually found a working solution!

It is a script one runs with PowerShell, that resets the state.

So, for anyone else with the same issue, I hope this helps:

https://gist.github.com/heaths/1d0658c6903871e09b72395c9ab44db1#file-reset-instancestate-ps1

like image 37
onmyway Avatar answered Sep 21 '22 10:09

onmyway