Create a network installation of Visual Studio

Sometimes an enterprise administrator wants to create a network install point that contains Visual Studio files that can be deployed to client workstations. This is to facilitate scenarios where the client machines may have limited permissions or limited access to the internet, or when internal teams want to do compatibility testing before their organization standardizes on a particular version of the developer toolset. We've designed Visual Studio so that an administrator can create a network layout which is essentially creating a file cache located on an internal static network share that includes all the Visual Studio files for both initial installation and all future product updates.

Note

  • If you have multiple editions of Visual Studio in use within your enterprise (for example, both Visual Studio 2019 Professional and Visual Studio 2019 Enterprise), you must create a separate network install share for each edition.
  • We recommend that you decide how you want the clients to receive product updates before you do the initial client install. This makes it easier to ensure that your configuration options are set correctly. Your choices include having the clients get updates from the network layout location or from the internet.
  • The original Visual Studio installation layout and all subsequent product updates must be located in the same network directory to ensure that repair and uninstall functionality works properly.

Download the Visual Studio bootstrapper

Download a bootstrapper file for the edition of Visual Studio you want. Make sure to choose Save, and then choose Open folder.

To get the latest bootstrapper for Visual Studio 2017 version 15.9, go to the Visual Studio previous versions page and download one of the following bootstrapper files:

Edition Filename
Visual Studio 2017 Enterprise version 15.9 vs_enterprise.exe
Visual Studio 2017 Professional version 15.9 vs_professional.exe
Visual Studio 2017 Build Tools version 15.9 vs_buildtools.exe

Other supported bootstrappers include vs_feedbackclient.exe, vs_teamexplorer.exe, vs_testagent.exe, vs_testcontroller.exe, and vs_testprofessional.exe.

Start by downloading the Visual Studio 2019 bootstrapper from either the Visual Studio downloads page or the Visual Studio 2019 Releases page for your chosen version and edition of Visual Studio. Your setup executable—or to be more specific, a bootstrapper file—will match or be similar to one of the following:

Edition Download
Visual Studio Enterprise vs_enterprise.exe
Visual Studio Professional vs_professional.exe
Visual Studio Build Tools vs_buildtools.exe

Other supported bootstrappers include vs_teamexplorer.exe, vs_testagent.exe, and vs_testcontroller.exe.

![!TIP] Released versions of Visual Studio 2022 are not yet available, the bootstrappers below are for the preview release of Visual Studio 2022. Start by downloading the Visual Studio 2022 bootstrapper from the Visual Studio downloads page.

Edition Download
Visual Studio Enterprise vs_enterprise.exe
Visual Studio Professional vs_professional.exe

Tip

If you previously downloaded a bootstrapper file and want to verify what version it is, here's how. In Windows, open File Explorer, right-click the bootstrapper file, choose Properties, choose the Details tab, and then view the Product version number. To match that number to a release of Visual Studio, see Visual Studio build numbers and release dates.

Tip

If you previously downloaded a bootstrapper file and want to verify what version it is, here's how. In Windows, open File Explorer, right-click the bootstrapper file, choose Properties, choose the Details tab, and then view the Product version number. To match that number to a release of Visual Studio, see Visual Studio 2019 Releases.

Tip

If you previously downloaded a bootstrapper file and want to verify what version it is, here's how. In Windows, open File Explorer, right-click the bootstrapper file, choose Properties, choose the Details tab, and then view the Product version number. To match that number to a release of Visual Studio, see Visual Studio 2022 Releases.

Create an offline installation folder

You must have an internet connection to complete this step.

Open a command prompt, navigate to the directory that you downloaded the bootstrapper into, and use the bootstrapper's parameters as defined in the Use command-line parameters to install Visual Studio page to create and maintain your network installation cache. Common examples of creating initial layouts are illustrated below and in Command-line parameter examples for Visual Studio installation.

Important

A complete initial layout for a single language locale requires about 35 GB of disk space for Visual Studio Community and 42 GB for Visual Studio Enterprise. Additional language locales require about half a GB each. See the Customize the network layout section for more info. Be mindful that subsequent layout updates must also be stored in this same network location, so expect that the directory contents of the network layout location can get quite large over time.

  • To create an initial layout of Visual Studio Enterprise with all languages and all features, run:

    vs_enterprise.exe --layout c:\VSLayout

  • To create an initial layout of Visual Studio Professional with all languages and all features, run:

    vs_professional.exe --layout c:\VSLayout

Modify the response.json file

You can modify the response.json file to set default values that are used when setup is run. For example, you can configure the response.json file to select a specific set of workloads that should be selected automatically. You can also configure the response.json to specify if the client should only receive updated files from the network layout location. For more information, see Automate Visual Studio installation with a response file.

If you run into a problem with the Visual Studio bootstrapper throwing an error when you pair it with a response.json file, see Troubleshoot network-related errors when you install or use Visual Studio page for more information.

Copy the layout to a network share

Host the layout on a network share so it can be run from the client machines.

The following example uses xcopy. You can also use robocopy, should you wish.

Example:

xcopy /e c:\VSLayout \\server\products\VS2017
xcopy /e c:\VSLayout \\server\products\VS2019
xcopy /e c:\VSLayout \\server\products\VS2022

Important

To prevent an error, make sure that your full layout path is less than 80 characters.

Customize the network layout

There are several options you can use to customize your network layout. You can create a partial layout that only contains a specific set of language locales, workloads, components, and their recommended or optional dependencies. This might be useful if you know that you're going to deploy only a subset of workloads to client workstations. Typical command-line parameters for customizing the layout include:

  • --add to specify workload or component IDs.
    If --add is used, only those workloads and components specified with --add are downloaded. If --add isn't used, all workload and components are downloaded.
  • --includeRecommended to include all the recommended components for the specified workload IDs
  • --includeOptional to include all the recommended and optional components for the specified workload IDs.
  • --lang to specify language locales.

Here are a few examples of how to create a custom partial layout.

  • To download all workloads and components for only one language, run:

    vs_enterprise.exe --layout C:\VSLayout --lang en-US
    
  • To download all workloads and components for multiple languages, run:

    vs_enterprise.exe --layout C:\VSLayout --lang en-US de-DE ja-JP
    
  • To download one workload for all languages, run:

    vs_enterprise.exe --layout C:\VSLayout --add Microsoft.VisualStudio.Workload.Azure --includeRecommended
    
  • To download two workloads and one optional component for three languages, run:

    vs_enterprise.exe --layout C:\VSLayout --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Component.GitHub.VisualStudio --includeRecommended --lang en-US de-DE ja-JP
    
  • To download two workloads and all of their recommended components:

    vs_enterprise.exe --layout C:\VSLayout --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Component.GitHub.VisualStudio --includeRecommended
    
  • To download two workloads and all of their recommended and optional components, run:

    vs_enterprise.exe --layout C:\VSLayout --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Component.GitHub.VisualStudio --includeOptional
    

Save your layout options

When you run a layout command, the options that you specify are saved (such as the workloads and languages). Subsequent layout commands will include all of the previous options. Here is an example of a layout with one workload for English only:

vs_enterprise.exe --layout c:\VSLayout --add Microsoft.VisualStudio.Workload.ManagedDesktop --lang en-US

When you want to update that layout to a newer version, you don't have to specify any additional command-line parameters. The previous settings are saved and used by any subsequent layout commands in this layout folder. The following command will update the existing partial layout.

vs_enterprise.exe --layout c:\VSLayout

When you want to add an additional workload, here's an example of how to do so. In this case, we'll add the Azure workload and a localized language. Now, both Managed Desktop and Azure are included in this layout. The language resources for English and German are included for all these workloads. The layout is updated to the latest available version.

vs_enterprise.exe --layout c:\VSLayout --add Microsoft.VisualStudio.Workload.Azure --lang de-DE

If you want to update an existing layout to a full layout, use the --all option, as shown in the following example.

vs_enterprise.exe --layout c:\VSLayout --all

Deploy from a network installation

Administrators can deploy Visual Studio onto client workstations as part of an installation script. Or, users who have administrator rights can run setup directly from the share to install Visual Studio on their machine.

  • Users can install by running the following command:

    \\server\products\VS\vs_enterprise.exe
    
  • Administrators can install in an unattended mode by running the following command:

    \\server\products\VS\vs_enterprise.exe --quiet --wait --norestart
    

Important

To prevent an error, make sure that your full layout path is less than 80 characters.

Tip

When executed as part of a batch file, the --wait option ensures that the vs_enterprise.exe process waits until the installation is complete before it returns an exit code.

This is useful if an enterprise administrator wants to perform further actions on a completed installation (for example, to apply a product key to a successful installation) but must wait for the installation to finish to handle the return code from that installation.

If you do not use --wait, the vs_enterprise.exe process exits before the installation is complete and returns an inaccurate exit code that doesn't represent the state of the install operation.

Important

For offline installations, if you get an error message that says "A product matching the following parameters cannot be found", make sure that you are using the --noweb switch with version 16.3.5 or later.

When you install from a layout, the content that is installed is acquired from the layout. However, if you select a component that isn't in the layout, it will be acquired from the internet. If you want to prevent Visual Studio setup from downloading any content that is missing in your layout, use the --noWeb option. If --noWeb is used and the layout is missing any content that is selected to be installed, setup fails.

Tip

If you want to install from an offline source on a non-internet connected computer, specify both the --noWeb and --noUpdateInstaller options. The former prevents downloading updated workloads, components, and so on. The latter prevents the installer from self-updating from the web.

Important

The --noWeb option does not stop Visual Studio setup on an internet-connected computer from checking for updates. For more information, see the Control updates to network-based Visual Studio deployments page.

Error codes

If you used the --wait parameter, then depending on the result of the operation, the %ERRORLEVEL% environment variable is set to one of the following values:

Value Result
0 Operation completed successfully
740 Elevation required
1001 Visual Studio installer process is running
1003 Visual Studio is in use
1602 Operation was canceled
1618 Another installation running
1641 Operation completed successfully, and reboot was initiated
3010 Operation completed successfully, but install requires reboot before it can be used
5003 Bootstrapper failed to download installer
5004 Operation was canceled
5005 Bootstrapper command-line parse error
5007 Operation was blocked - the computer does not meet the requirements
8001 Arm machine check failure
8002 Background download precheck failure
8003 Out of support selectable failure
8004 Target directory failure
8005 Verifying source payloads failure
8006 Visual Studio processes running
-1073720687 Connectivity failure
-1073741510 Microsoft Visual Studio Installer was terminated (by the user or external process)
Other
(for example:
-1, 1, 1603)
Failure condition occurred - check the logs for more information

Update a network install layout

As product updates become available, you might want to update the network install layout to incorporate updated packages.

How to create a layout for a previous Visual Studio release

First you need to understand that there are two types of Visual Studio bootstrappers - one that can be characterized by the words "latest", "current", "evergreen" and "tip", and one that essentially means "fixed version". Both types of bootstrapper files have the exact same name, and the best way to distinguish the type is to pay attention to where you got it from. The Visual Studio bootstrappers available on the Visual Studio downloads page are considered evergreen Visual Studio bootstrappers, and they always install (or update) the latest release that's available in the channel at the time the bootstrapper is run. The Visual Studio bootstrappers available on the Visual Studio 2019 Releases Visual Studio 2022 Releases page, or that are embedded inside the administrator update in the Microsoft Update Catalog install a particular fixed version of the product.

So, if you download an evergreen Visual Studio bootstrapper today and run it six months from now, it will install the Visual Studio release that is current at the time the bootstrapper is run. It's designed to always install the latest bits and keep you current.

If you download a fixed-link bootstrapper, or if you run an administrator update that you downloaded from the Microsoft Catalog, then it will always install a particular version of the product, no matter when it was run.

Lastly, you can create a network layout using any one of these bootstrappers, and the version that will get created in the layout depends on the bootstrapper you're using, for example, it will either be a fixed version or current. You can then update the network layout using any later bootstrapper or you can also use the administrator update package from the Microsoft Update Catalog. Regardless of how you update the layout, the resulting updated layout will be a package cache that contains a particular version of the product, and it will then behave like a fixed link bootstrapper. So, whenever the client installs from the layout, the client will install the specific version of Visual Studio that exists in the layout (even though a newer version might exist online).

How to get support for your offline installer

If you experience a problem with your offline installation, we want to know about it. The best way to tell us is by using the Report a Problem tool. When you use this tool, you can send us the telemetry and logs we need to 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. For a list, see our Feedback page.

See also