How to update visual studio

How to update visual studio

Visual Studio and servicing baselines

Visual Studio is updated frequently during its product lifecycle. There are two main types of updates: feature updates and servicing updates. Feature updates are indicated by a change in the minor version number, such as 16.4 to 16.5, and they contain significant product updates. Servicing updates consist of critical quality or security fixes and they are denoted by a change in the servicing version number, such as 16.7.8 to 16.7.9.

A servicing baseline, also referred to as a Long-Term Servicing Channel (LTSC) is a particular minor version that is supported and kept secure for about a year longer than other minor versions. The purpose of servicing baselines is to give Enterprise and Professional customers a way to adopt and stay on a very stable product and minimize compatibility risk while also staying secure. Refer to the Visual Studio support lifecycle documentation for information about support for secure baselines.

How to configure your client machine to stay on a servicing baseline

In Visual Studio 2019, it was a challenge to stay on a servicing baseline. You had to use the specific minor version bootstrapper available on either My.VisualStudio.Com or the Visual Studio 2019 release history page to update your client or your layout with the specific version you wanted. You also sometimes needed to perform additional customizations to fine tune the experience.

In Visual Studio 2022, we vastly improved the experience of easily configuring a client machine to stay on a servicing baseline. Using the Visual Studio 2022 installer, which can also be used by older versions of Visual Studio such as Visual Studio 2019, you can now configure where your clients will get their updates from using the Update settings dialog or the modifySettings command. These update source locations are called «channels», and you can find more information about channel purpose and availability in the Visual Studio Release Rhythm documentation. Microsoft makes both the Current and the Preview channels available to everyone, and the Long-Term Servicing Channels (LTSCs) are available to Enterprise and Professional customers. IT Administrators can also configure network layouts as valid update source locations that the clients could have access to.

How to stay on a servicing baseline

When an update for a servicing baseline is available, fixed-version bootstrapper files are made available for the servicing update at My.VisualStudio.com.

For administrators who deploy by using a network layout install, the administrator should update the layout location. Clients that installed from the location will receive update notifications. If the update must be deployed to clients, follow these instructions. When you modify the ‘response.json’ for an update, do not add additional workloads, components, or languages. Managing these settings must be done as a ‘modify’ deployment after the product has been updated.

Update the Visual Studio installer:

Support or troubleshooting

Sometimes, things can go wrong. If your Visual Studio installation fails, see Troubleshoot Visual Studio installation and upgrade issues for step-by-step guidance.

Here are a few more support options:

Обновление Visual Studio с использованием минимального автономного макета

Для компьютеров, не подключенных к Интернету, создание минимального макета — самый простой и быстрый способ обновления автономных экземпляров Visual Studio.

Средство минимальных макетов создает макет, специально предназначенный для нужд вашей команды. Администраторы предприятия могут с помощью этого средства создавать макеты обновления для большинства версий Visual Studio 2017 и 2019. В отличие от полного макета Visual Studio минимальный макет содержит только обновленные пакеты, поэтому он всегда меньше и быстрее создается и развертывается. Макет обновления можно еще более уменьшить, указав только нужные языки, рабочие нагрузки и компоненты.

Создание минимального макета

В этих инструкциях предполагается, что вы уже создавали и использовали макеты. Дополнительные сведения об этом см. на странице Обновление сетевой установки Visual Studio.

Дополнительные сведения о жизненном цикле Visual Studio см. на странице Жизненный цикл и обслуживание продуктов Visual Studio.

Это средство создает макеты обновления для Visual Studio 2017 (15.9) и более поздних версий. Макет можно развернуть на сетевых или автономных компьютерах для обновления экземпляров Visual Studio. Во время создания обычного макета скачиваются все пакеты для конкретного выпуска. Создание обычного макета требуется для восстановления, удаления и других стандартных операций с экземплярами Visual Studio. Для минимального макета скачиваются только обновленные пакеты, поэтому он меньше и его проще копировать на автономные компьютеры.

Установка средства минимальных макетов

Сначала скачайте средство минимальных макетов с этой страницы. При появлении запроса нажмите кнопку Сохранить, а затем кнопку Выполнить.

How to update visual studio. Смотреть фото How to update visual studio. Смотреть картинку How to update visual studio. Картинка про How to update visual studio. Фото How to update visual studio

Затем примите запрос системы контроля учетных записей, нажав кнопку Да.

How to update visual studio. Смотреть фото How to update visual studio. Смотреть картинку How to update visual studio. Картинка про How to update visual studio. Фото How to update visual studio

Использование средства минимальных макетов

MinimalLayout.exe использует перечисленные ниже команды и параметры для создания макета. Для запуска средства требуется по крайней мере одна команда. Средство запускается так:

Команды

Предварительная версия. Используйте эту команду для предварительного просмотра количества скачиваемых пакетов и общего пространства, которое необходимо для создания данного макета.

Создание: Используйте эту команду, чтобы создать минимальный макет для обновления Visual Studio.

Для этой команды требуется путь к файлу MinimalLayout.json уже созданного макета.

Verify. Используйте эту команду, чтобы определить, повреждена ли папка макета.

Fix. Используйте эту команду, чтобы исправить поврежденную папку макета, в том числе заменить в ней все отсутствующие пакеты.

Параметры

Создание минимального макета

В этих инструкциях предполагается, что макет сетевой установки уже создан. Дополнительные сведения см. на странице Создание сетевой установки Visual Studio.

Создайте минимальный макет для указанного диапазона версий с помощью команды generate. Необходимо также знать идентификатор продукта, языки и требуемые рабочие нагрузки. Этот минимальный макет обновит все экземпляры Visual Studio начиная с базовой версии до целевой версии включительно.

Перед созданием макета можно определить общий размер скачиваемых данных и число включаемых пакетов с помощью команды preview. Эта команда принимает те же параметры, что и команда generate, а сведения выводятся в консоли.

Рассмотрим несколько примеров предварительного просмотра, создания и повторного создания минимального макета.

Ниже приведен пример предварительного просмотра макета для версий Visual Studio Enterprise с 16.4.0 по 16.4.4 только для английского языка.

Ниже показано, как создать этот же макет с одной рабочей нагрузкой.

Теперь повторно создадим минимальный автономный макет с помощью существующего файла ответов.

Еще несколько примеров с использованием команды generate:

Ниже показано добавление дополнительной рабочей нагрузки и включение только рекомендуемых пакетов.

Можно также создать минимальный автономный макет, поддерживающий несколько продуктов.

Наконец, так можно включить несколько языков в минимальный макет.

Обслуживание минимального макета

Для обслуживания минимального макета после его создания используйте команды verify и fix. Команда verify определяет наличие поврежденных или отсутствующих пакетов в минимальном макете. Если после выполнения команды verify были обнаружены проблемы, используйте команду fix, чтобы исправить поврежденные пакеты или добавить отсутствующие.

Так можно проверить, есть ли в макете поврежденные или отсутствующие пакеты:

Исправить макет можно так:

Этот макет нельзя использовать для восстановления установки Visual Studio. Сведения об исправлении существующего экземпляра Visual Studio см. в статье Восстановление Visual Studio.

Использование минимального автономного макета для обновления существующей установки Visual Studio

После создания минимального макета можно скопировать всю его папку на клиентский компьютер. Это необходимо, если у компьютера нет доступа к исходному расположению папки минимального макета.

Перейдите в папку и определите имя начального загрузчика. Имя начального загрузчика зависит от значения ProductId, указанного при создании минимального макета. Распространенные варианты приведены в таблице ниже.

Значение ProductIdимя приложения;
Microsoft.VisualStudio.Product.Enterprisevs_enterprise.exe
Microsoft.VisualStudio.Product.Professionalvs_professional.exe
Microsoft.VisualStudio.Product.BuildToolsvs_buildtools.exe

Обновление применяется к экземпляру Visual Studio в два шага. Сначала обновите Visual Studio Installer, а затем саму среду Visual Studio.

Обновление Visual Studio Installer

Выполните следующую команду, заменив vs_enterprise.exe правильное имя приложения начального загрузчика при необходимости.

Обновление приложения Visual Studio

Чтобы обновить Visual Studio, необходимо указать путь установки экземпляра Visual Studio, который следует обновить. Если установлено несколько экземпляров Visual Studio, каждый из них необходимо обновить отдельно. Мы настоятельно рекомендуем указать параметр –noWeb с командой update, чтобы предотвратить установку компонентов, которые не входят в минимальный макет. Это позволит избежать перевода Visual Studio в непригодное для использования состояние.

Выполните приведенную ниже команду, подставив нужное значение для параметра командной строки installPath. Кроме того, используйте соответствующее имя начального загрузчика.

Обновление Visual Studio Installer

Выполните следующую команду, заменив vs_enterprise.exe правильное имя приложения начального загрузчика при необходимости.

Обновление приложения Visual Studio

Чтобы обновить Visual Studio, необходимо указать путь установки экземпляра Visual Studio, который следует обновить. Если установлено несколько экземпляров Visual Studio, каждый из них необходимо обновить отдельно. Мы настоятельно рекомендуем указать параметр –noWeb с командой update, чтобы предотвратить установку компонентов, которые не входят в минимальный макет. Это позволит избежать перевода Visual Studio в непригодное для использования состояние.

Выполните приведенную ниже команду, подставив нужное значение для параметра командной строки installPath. Кроме того, используйте соответствующее имя начального загрузчика.

Поддержка или устранение неполадок

Иногда возникают проблемы. Если установить Visual Studio не удается, воспользуйтесь пошаговыми указаниями в статье Устранение неполадок при установке и обновлении Visual Studio.

Ниже приведены несколько дополнительных вариантов:

Visual Studio и базовые планы обслуживания

Visual Studio часто обновляется в течение жизненного цикла продукта. Существует два основных типа обновлений: обновления компонентов и обслуживающие обновления. Обновления компонентов обозначаются изменением дополнительного номера версии, например 16.4 на 16.5, и содержат значительные обновления продукта. Обслуживающие обновления содержат исправления критических проблем с качеством или безопасностью и обозначаются изменением номера обслуживаемой версии, например 16.7.8 на 16.7.9.

Базовый план обслуживания, также известный как Long Term Servicing Channel (LTSC), представляет собой конкретный дополнительный номер версии, для которого обеспечивается поддержка и защита примерно на год дольше, чем для других дополнительных номеров версии. Базовые планы обслуживания предназначены для того, чтобы предоставить клиентам Enterprise и Professional возможность внедрить самую стабильную версию продукта и остаться на ней, а также снизить риск совместимости и обеспечить безопасность. Сведения о поддержке надежных базовых планов см. в документации по жизненному циклу поддержки Visual Studio.

Как настроить клиентский компьютер, чтобы оставаться на базовом плане обслуживания

В Visual Studio 2019 оставаться на базовом плане обслуживания было сложно. Вам приходилось использовать начальный загрузчик для конкретного дополнительного номера версии, доступный на сайте My.VisualStudio.Com или на странице журнала выпусков Visual Studio 2019, чтобы обновить клиент или макет до определенной версии. Кроме того, иногда требовалось выполнять дополнительные настройки, чтобы настроить процесс.

Как оставаться на базовой версии

При выходе обновления для базовой версии на сайте My.VisualStudio.com публикуются файлы загрузчика определенной версии для служебного обновления.

При развертывании с помощью макета сетевой установки администратору потребуется обновить расположение макета. Клиенты, установленные из расположения, получат уведомления об обновлении. Если требуется развернуть обновление в клиентах, следуйте этим инструкциям. При изменении файла response.json для обновления не добавляйте дополнительные рабочие нагрузки, компоненты или языки. Управление этими параметрами должно выполняться как «модифицирующее» развертывание после обновления продукта.

Обновите установщик Visual Studio.

Поддержка или устранение неполадок

Иногда возникают проблемы. Если установить Visual Studio не удается, воспользуйтесь пошаговыми указаниями в статье Устранение неполадок при установке и обновлении Visual Studio.

Ниже приведены несколько дополнительных вариантов:

Update Visual Studio using a minimal offline layout

For computers that are not connected to the internet, creating a minimal layout is the easiest and fastest way to update your offline Visual Studio instances.

The minimal layout tool generates a layout tailored specifically to your team’s needs. Enterprise administrators can use this tool to create update layout(s) for most versions for Visual Studio 2017 and 2019. Unlike a full Visual Studio layout, a minimal layout only contains the updated packages, so it is always smaller and faster to generate and deploy. You can further minimize the size of the update layout by specifying only the desired languages, workloads, and components.

How to generate a minimal layout

These instructions assume that you’ve previously created and used layouts. For more information about how to do so, see the Update a network-based installation of Visual Studio page.

For a better understanding of the Visual Studio lifecycle, see the Visual Studio Product Lifecycle and Servicing page.

This tool creates update layouts for Visual Studio 2017 (15.9) and onwards. The layout can be deployed to network/offline machines to update Visual Studio instances. During normal layout creation, all the packages for that particular release are downloaded. Normal layout creation is required for repairing, uninstalling, and other standard operations on Visual Studio instances. The minimal layout downloads only updated packages, so it’s smaller and easier to copy to offline machines.

Installing the minimal layout tool

First, download the minimal layout tool located here. Make sure to choose Save when prompted, then select Run.

How to update visual studio. Смотреть фото How to update visual studio. Смотреть картинку How to update visual studio. Картинка про How to update visual studio. Фото How to update visual studio

Next, accept the User Account Control prompt by clicking Yes.

How to update visual studio. Смотреть фото How to update visual studio. Смотреть картинку How to update visual studio. Картинка про How to update visual studio. Фото How to update visual studio

How to use the minimal layout tool

MinimalLayout.exe uses the following commands and options to generate the layout. At least one command is required to run the tool. Here’s how you’ll run the tool:

Commands

Preview: Use this command to preview how many packages will download, and the total space used to create this layout.

Generate: Use this command to generate the minimal layout for updating Visual Studio.

Regenerate: Use this command to regenerate a layout using an existing minimal layout response file. Every minimal layout produces a MinimalLayout.json response file, which contains the original minimal layout input parameters. You can use the Regenerate command and a MinimalLayout.json response file to regenerate the minimal layout. This is useful if you want to create a minimal layout for a new Visual Studio update based on the previous minimal layout’s response file.

For this command, a MinimalLayout.json file path from an already generated layout is required.

Verify: Use this command to determine if the layout folder is corrupted.

Fix: Use this command to fix a corrupted layout folder, including replacing any missing packages from the layout folder.

Options

Generating a minimal layout

These instructions assume that you’ve previously created a network installation layout. For more information about how to do so, see the Create a network installation of Visual Studio page.

Create a minimal layout using the generate command for your specified range of versions. You’ll also need to know the productId, languages, and any specific workloads required. This minimal layout will update any Visual Studio instance from the base version up to and including the target version.

Before creating the layout, you can find out the total size of the download and the number of packages included by using the preview command. This command takes the same options as the generate command, and the details are written to the console.

Let’s walk through a few examples of how to preview, generate, and regenerate a minimal layout:

First, here’s an example of how to preview a layout for Visual Studio Enterprise versions 16.4.0 to 16.4.4 for English only.

Here’s how to generate that same layout with one workload.

And here’s how to regenerate a minimal offline layout using an existing response file.

A few other examples using the generate command:

Here’s how to add an additional workload, and include only the recommended packages.

You can also generate a minimal offline layout which supports multiple products.

And finally, here’s how you’d include multiple languages in your minimal layout.

How to maintain a minimal layout

Use the verify and fix commands to maintain your minimal layout after it’s created. The verify command determines if there are any corrupt or missing packages in the minimal layout. If you encounter any problems after running the verify command, use the fix command to correct those missing or corrupt packages.

Here’s how to verify if a layout has corrupt or missing packages:

And here’s how to fix that layout:

This layout cannot be used to repair a Visual Studio installation. To repair an existing instance of Visual Studio, see Repair Visual Studio.

How to use a minimal offline layout to update an existing installation of Visual Studio

After generating a minimal layout, you can copy the entire minimal layout folder to a client machine. This is required if the computer doesn’t have access to the minimal layout folder in its original location.

Navigate to the folder and identify the bootstrapper application name. The name of the bootstrapper application depends on the ProductId value specified while generating the minimal layout. Refer to the table below for common examples.

ProductId valueApplication name
Microsoft.VisualStudio.Product.Enterprisevs_enterprise.exe
Microsoft.VisualStudio.Product.Professionalvs_professional.exe
Microsoft.VisualStudio.Product.BuildToolsvs_buildtools.exe

The update is applied to a Visual Studio instance in two steps. Start by updating the Visual Studio Installer, then update Visual Studio.

Update the Visual Studio Installer

Run the following command, substituting vs_enterprise.exe with the correct bootstrapper application name if necessary.

Update the Visual Studio application

To update Visual Studio, you need to specify the installPath of the Visual Studio instance you wish to update. If multiple instances of Visual Studio are installed, each one needs to be updated separately. We strongly recommend you specify the –noWeb option with the update command to prevent the installation of components that aren’t in the minimal layout. This prevents you from leaving Visual Studio in an unusable state.

Run the following command, substituting the installPath command-line parameter appropriately. Be sure to use the correct bootstrapper application name as well.

Update the Visual Studio Installer

Run the following command, substituting vs_enterprise.exe with the correct bootstrapper application name if necessary.

Update the Visual Studio application

To update Visual Studio, you need to specify the installPath of the Visual Studio instance you wish to update. If multiple instances of Visual Studio are installed, each one needs to be updated separately. We strongly recommend you specify the –noWeb option with the update command to prevent the installation of components that aren’t in the minimal layout. This prevents you from leaving Visual Studio in an unusable state.

Run the following command, substituting the installPath command-line parameter appropriately. Be sure to use the correct bootstrapper application name as well.

Support or troubleshooting

Sometimes, things can go wrong. If your Visual Studio installation fails, see Troubleshoot Visual Studio installation and upgrade issues for step-by-step guidance.

Here are a few more support options:

Update a Visual Studio client that was installed from a network layout

You can and should periodically update all Visual Studio clients so that they receive the latest security and functionality fixes.

If the Visual Studio client was originally installed via a network layout, then most likely the client machine is part of a «managed environment» meaning that it is governed by a central administrative team and must adhere to organizational policies. To update client machines in a managed environment consider the questions below whose answers will inform how you should approach the update process.

Prepare the update source

If you are going to update your client from Microsoft hosted servers, then the client will download and install the latest version available from Microsoft on that channel.

If you are going to update your client from a network layout, then the first step is to prepare the network layout with the updated product. You can update your existing layout with the latest product updates so both new installations and updates will receive the updated version. Or, you can create a whole new layout in a different directory that you can use for updating the client machines.

Enable manual user-initiated client-side updates

A user on the client machine with sufficient permissions can manually initiate the Visual Studio update themselves. The Visual Studio client must be configured properly to look in the right source location for updates so that it can recognize that an update is available. If any files are in use when the update happens, like if Visual Studio is open, then Visual Studio will need to close to complete the update. Occasionally an update will require a reboot.

Manually configure where the Visual Studio client looks for updates

When Visual Studio is initially installed on the client machine, it records the location where it should check for updates. If Visual Studio was installed from Microsoft hosted servers, then it will by default look for updates from Microsoft hosted servers. If Visual Studio was installed or updated by invoking a bootstrapper on a network layout, then it will look for updates in the location specified by the layout.

With default Visual Studio 2019 functionality, once the client has installed the product, the client’s update location configuration is locked and unchangable. The only way to reliably change the source location for updates is to uninstall and reinstall the product using the correct configuration.

However, if the Visual Studio client uses the latest Visual Studio 2022 Installer, then the client’s source location for updates can be changed. This is useful if you want to install from one layout but have updates come from another layout. There are two ways to get the Visual Studio 2022 Installer onto a client machine. The easiest is to simply install and use the Visual Studio 2022 product. Alternatively, you can distribute the Visual Studio 2022 installer via your Visual Studio 2019 layouts.

To manually view and configure the update location that the client will look for updates from, bring up the Update Settings, make sure it’s configured correctly. You can then initiate the update from the client.

Update notifications

If there is an update available in the location that the client is looking for updates, then the client will pop a message or a notification flag.

For details on how to control when update notifications are presented to users, see Control updates to network-based Visual Studio deployments.

Manually initiate the update

Users can manually update a Visual Studio instance by:

Programatically update the client machines

Administrators can programmatically update the client installations of Visual Studio by either issuing the commands to the client-side installer, or by invoking a bootstrapper in the layout.

Programatically update Visual Studio by using the Visual Studio Installer

You can change the channel to a network layout and execute an update command on the client like this:

or like this, which sets the source of updates to a Microsoft hosted location:

Programatically update Visual studio by using a bootstrapper.

You can update Visual Studio by programatically calling a bootstrapper from the same location that you originally installed from. All bootstrappers sourced from Microsoft hosted servers are considered from the same location. If your bootstrapper was on a network layout share, then the network layout must be updated to contain the desired product updates.

You can also initiate an update your Visual Studio 2019 client by programatically calling a bootstrapper from a different source location that contains the version of the product that you want to update the client to. To do this, you need to get the Visual Studio 2022 installer on the client. The easiest way to enable this is to ensure your new Visual Studio 2019 layout is using the latest installer. If you run bootstrapper from a new layout, then the update channel on the client will be set to the update location specified in the layout. For example, you can run this command on the client machine:

You can also initiate an update to your Visual Studio client by programatically calling a bootstrapper from a different source location that contains the version of the product that you want to update the client to. If you run bootstrapper from a new layout, then the update channel on the client will be set to the update location specified in the layout. For example, you can run this command on the client machine:

Whatever the value of the channelURI in the new layout’s response.json file will be the location where the client looks for future updates.

Use the vswhere.exe command to identify the install path of an existing instance of Visual Studio on a client machine.

Programatically update a client that doesn’t have internet access

If your client machine doesn’t have internet access, then it must acquire the updates from a network layout. Remember that there are two parts that need to get updated whenever Visual Studio is updated. The first is the installer and the second is the Visual Studio product itself. You can instruct Visual Studio to explicitly look for both of these components from the network layout by running these commands on the client machine. The first command forces the installer to come from the layout, and the second command prevents any packages from being downloaded from Microsoft hosted servers on the internet.

Get support for your network layout

If you experience a problem with your network layout, we want to know about it. The best way to tell us is by using the Report a Problem tool that appears both in the Visual Studio Installer and in the Visual Studio IDE. If you’re an IT Administrator and don’t have Visual Studio installed, you can submit IT Admin feedback here. When you use this tool, it would be very helpful if you could send the logs from the VS Collect tool which can help us diagnose and fix the problem.

We also offer an installation chat (English only) support option for installation-related issues.

We have other support options available, too. See our Visual Studio Developer Community.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *