Cannot install Visual Studio 2017 community edition after sudden shutdown

2

I started installing VS and then my computer turned off suddenly (due to overheating).

When I was reinstalling it, an error message appeared saying:

Can't install in a non empty folder.

So I deleted the folder C:\Program Files (x86)\Microsoft Visual Studio\2017\community

Then, when I tried to install it, it failed.

This is the log:

[2a18:0008][2017-06-09T09:08:50] Error 0x80004003: at Microsoft.VisualStudio.Setup.Cache.InstanceRepository.GetInstance()
at Microsoft.VisualStudio.Setup.Cache.CacheRepository.d__28.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Microsoft.VisualStudio.Setup.Engine.VerifyInstallationPath(IServiceProvider services, String installationPath, IInstance instance, IQuery query)
at Microsoft.VisualStudio.Setup.Engine.Install(Product product, String destination, CancellationToken token)Object reference not set to an instance of an object.

visual-studio
installation
visual-studio-2017
reinstall
asked on Stack Overflow Jun 9, 2017 by mshwf • edited Jun 9, 2017 by piet.t

3 Answers

6

Go to your folder C:\Program Files (x86)\Microsoft Visual Studio\2017\community Make sure this folder is Empty. There shouldn't be any other directory inside, then check your error has been gone and Install button is enabled.

answered on Stack Overflow Aug 17, 2017 by AirCodeOne
4

Refer to the error message, you can try to completely remove the installed VS 2017 as below:

  1. Go to Control Panel-Programs and Features, right click the VS 2017 and ‘Uninstall’

  2. Manually remove or delete the VS 2017 installation folders: %ProgramData%\Microsoft\VisualStudio\Packages and C:\Program Files (x86)\Microsoft Visual Studio\2017\community

Please have a look at this similar issue: Visual Studio 2017 RC Setup Operation Failed

answered on Stack Overflow Jun 9, 2017 by Sara Liu - MSFT
-1

Just create a new directory and delete the corrupted one. Go to the folder location where visual studio will be installed which is in programs (x86) I believe and create a new directory in Microsoft Visual Studio, then on installation wizard just select the folder you created!

good luck. hope this helped

answered on Stack Overflow Mar 1, 2019 by Murali Raja

User contributions licensed under CC BY-SA 3.0