Visual Studio Installation Troubleshooting
ENG
What happened
On May 11, 2022, while refining the InstallVS.bat script, we encountered issues due to something happening on Microsoft's end. Essentially, nothing prevents this event from reoccurring. We would like to document the problems encountered and possible solutions. The experience gained could also be useful in addressing other incidents.
Problem #1. Visual Studio won't install
The most current version of Visual Studio 2019 at the time of refinement was 16.11.13. When the installation via the script broke, all versions higher than 16.11.11 disappeared from the list of available builds of VS. The InstallVS.bat script, however, downloads the latest version of Visual Studio, which at the time was 16.11.14! Apparently, these were side effects of releasing new versions on Microsoft's website. The installer for version 16.11.14 did not work; the script simply hung. From the logs, it was clear that the connection timed out. The installer for version 16.11.11, downloaded from the site, worked fine
Solution
Check list:
- Check the version of the downloaded installer. To do this, you need to open the installer with any archiver for example 7-Zip. Next go to the folder vs_bootstrapper_d15 and look into the file vs_setup_bootstrapper.config. Field value productSemanticVersion will contain the version Visual Studio.
- Check if this version is on the website in the list of available assemblies.
- Check the installer logs. They are in %TEMP% (usually it is in C:\Users\your_username\AppData\Local\Temp) and have a prefix dd_ and suffix as a string <Date><Time>. Example file name with initial installation logs: dd_bootstrapper_20220511075153.log. An example of a timeout crash:
VisualStudio Bootstrapper:5/11/2022 7:53:54 AM: Download failed using WebClient engine. System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse() at Microsoft.VisualStudio.Setup.Download.WebClientEngine.GetWebResponse(Uri uri, DownloadContext downloadContext, DownloadSummary& downloadSummary, HttpWebRequest& webRequest, CancellationToken cancellationToken) at Microsoft.VisualStudio.Setup.Download.WebClientEngine.DownloadCore(Uri uri, Stream stream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation) at Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.DownloadWithBitRate(Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation) at Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.Download(Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation) at Microsoft.VisualStudio.Setup.Download.DownloadManager.DownloadWithRetry(IDownloadEngine[] engines, Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, Boolean verifySignature)
If the situation is similar to the one described, it is likely that Microsoft is once again performing some manipulations with their website and/or CDN. As a solution, you can download the latest 16.X.Y version from those available on the site and manually install the necessary components (the list of components can be found in the script). When the website functionality is restored, you can use the InstallVS.bat script to update to the latest version.
Potential solutions that require further development and are not currently available:
- teach the script to accept the VS version for download as a parameter;
- use offline installer.
Problem #2. Visual Studio won't start
In the evening, all the old versions returned to the site, and new ones were added. The script downloaded the latest version of the installer (11/16/14). At the same time, downloading data was very slow (several kilobits per second).
At some point, the script finished working, but Visual Studio failed to start
Solution
Everything is likely fine. This message indicates that the VS installation is happening in the background. It appears that this occurs when the installer’s process was interrupted for some reason, such as a connection loss, computer restart, etc. You can monitor the installer’s progress via the Task Manager:
First, the installer downloads the missing components (Network column). After the download is complete, the installer needs some additional time to process the downloaded files. When it disappears from the list of active processes, you can try launching Visual Studio again. Everything should work!
Links
RUS
Что произошло
11 мая 2022 при доработке скрипта InstallVS.bat пришлось столкнуться с проблемами из-за того, что на стороне Microsoft что-то случилось. В принципе ничто не мешает повториться этому событию. Хотелось бы задокументировать проблемы и возможные пути их решения. Также полученный опыт может пригодиться при борьбе с другими инцидентами.
Проблема #1. Visual Studio не устанавливается
Самой актуальной версией Visual Studio 2019 на момент доработки была 16.11.13. Когда установка через скрипт сломалась, из списка доступных сборок VS исчезли все версии выше 16.11.11. InstallVS.bat при этом скачивает последнюю версию Visual Studio, и этой версией была 16.11.14! Видимо, это были побочные эффекты выкатывания новых версий на сайте Microsoft. Инсталлятор для версии 16.11.14 не работал, скрипт просто зависал, из логов стало понятно, что соединение вылетало по таймауту. Инсталлятор версии 16.11.11, скачанный с сайта, отрабатывал нормально.
Решение
Чек-лист:
- Проверить версию скачиваемого инсталлятора. Для этого нужно открыть инсталлятор любым архиватором, например, 7-Zip. Далее перейти в папку vs_bootstrapper_d15 и заглянуть в файл vs_setup_bootstrapper.config. Значение поля productSemanticVersion будет содержать версию Visual Studio.
- Проверить, есть ли данная версия на сайте в списке доступных сборок.
- Проверить логи инсталлятора. Они находятся в %TEMP% (обычно это C:\Users\your_username\AppData\Local\Temp) и имеют префикс dd_ и суффикс в виде строки <Дата><Время>. Пример имени файла с логами начальной установки: dd_bootstrapper_20220511075153.log. Пример падения по таймауту:
VisualStudio Bootstrapper:5/11/2022 7:53:54 AM: Download failed using WebClient engine. System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse() at Microsoft.VisualStudio.Setup.Download.WebClientEngine.GetWebResponse(Uri uri, DownloadContext downloadContext, DownloadSummary& downloadSummary, HttpWebRequest& webRequest, CancellationToken cancellationToken) at Microsoft.VisualStudio.Setup.Download.WebClientEngine.DownloadCore(Uri uri, Stream stream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation) at Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.DownloadWithBitRate(Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation) at Microsoft.VisualStudio.Setup.Download.DownloadEngineBase.Download(Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, ITelemetryOperation telemetryOperation) at Microsoft.VisualStudio.Setup.Download.DownloadManager.DownloadWithRetry(IDownloadEngine[] engines, Uri uri, Stream outputStream, ProgressUpdateCallback progress, CancellationToken cancellationToken, DownloadContext downloadContext, Boolean verifySignature)
Если ситуация похожа на описанную, то вероятно, что Microsoft снова производит какие-то манипуляции со своим сайтом и/или CDN. В качестве решения можно скачать последнюю 16.X.Y версию из доступных на сайте и установить нужные компоненты вручную (список компонентов можно посмотреть в скрипте). Когда работа сайта будет восстановлена, можно будет воспользоваться скриптом InstallVS.bat для обновления до актуальной версии.
Потенциальные способы решения, которые требуют доработок, и в данный момент недоступны:
- научить скрипт принимать в качестве параметра версию VS для скачивания;
- использовать оффлайн-инсталлятор.
Проблема #2. Visual Studio не запускается
Вечером все старые версии вернулись на сайт, а также добавились новые. Скрипт скачал последнюю версию инсталлятора (16.11.14). При этом скачивание данных было очень медленным (несколько килобит в секунду).
В какой-то момент скрипт закончил работу, но запустить Visual Studio не удалось.
Решение
Скорее всего всё в порядке. Данное сообщение говорит о том, что происходит установка VS в фоновом режиме. По всей видимости такое случается, когда работа инсталлятора была прервана по каким-то причинам, например, отсутствие соединения, перезагрузка компьютера и т.д. Работу инсталлятора можно отслеживать через Диспетчер задач:
Сначала инсталлятор загружает недостающие компоненты (колонка Сеть). После завершения загрузки инсталлятору нужно ещё какое-то время для манипуляций с загруженными файлами. Когда он исчезнет из списка активных процессов, то можно попробовать запустить Visual Studio ещё раз. Всё должно получиться!



