Cleaning up corrupt Visual Studio instances

Avatar

Heath

A small number of users are seeing errors after installing or modifying Visual Studio 2017 like the following,

Sorry, the installation failed. Please try again.

This may also manifest in some cases as,

A product matching the following parameters cannot be found:

channelId: VisualStudio.15.Release
productId: Microsoft.VisualStudio.Product.Enterprise

If you open the latest %TEMP%\dd_client*.log file you may see an exception stack trace like,

Subsequent operations in the Visual Studio Installer fail, and if you reopen the Visual Studio Installer you may not see any instances installed – only what products are available.

Solution

We have mitigated a couple of possible causes and continue to explore both mitigations and long-term remedies, but in the meantime, you will need to clean up, or obliterate, the instance and re-install.

  1. Open an elevated command prompt.
  2. Run: %ProgramFiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe -i

This will clean up only instance data such as the installation directory and state. This will make re-installing the instance faster since any workloads and components you had installed would remain cached and would not be re-downloaded.

If you don’t not find InstallCleanup.exe in %ProgramFiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout – or any directory there above – please download the latest bootstrapper from https://www.visualstudio.com/downloads/ and run it to install. When the workload selection dialog is shown, close the window and run the steps above again.

Update: for up-to-date information, please see https://aka.ms/vs/cleanup.

Avatar
Heath Stewart

Senior Software Engineer

Follow Heath   

3 comments

  • Avatar
    Omphe Disang

    Hi. What happen when I try to install visual studio 2015 community, while I’m installing it open for 10 sec then it close and it don’t show anything

  • Avatar
    KAREEM SULTHAN

    If you follow these steps you will be left with a feeling that you are a stupid. It just deletes all the files of current installation. When you open Visual Studio after performing these steps there will be nothing. Opening VS installer will prompt you to download and install the VS freshly because all the folders will be left empty after performing thise steps. I don’t know how Microsoft encourages these kind of blogs which simply pisses off VS users. 

Leave a comment