Sdílet prostřednictvím


Disable or move the package cache

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

The package cache provides a source of installed packages. You need these packages to repair Visual Studio or other related products when there's no internet connection. With some drives or system set ups, however, you might not want to keep all those packages around. The installer will download them when needed. If you want to save or recover disk space, you can disable or move the package cache.

Disable the package cache

Before you install, modify, or repair Visual Studio or other products with the new installer, you can start the installer with the --nocache switch to the installer.

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe" --nocache

Any operation you do on a product will remove any existing packages for that product and will avoid saving any packages after they're installed. If packages are required to modify or repair Visual Studio, they'll be downloaded automatically and removed after their installation.

If you want to re-enable the cache, pass --cache instead. Only packages that are required will be cached. If you need to restore all packages, we recommend you repair Visual Studio before you disconnect from your network.

"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe" repair --passive --norestart --cache

You can also set the KeepDownloadedPayloads registry policy to disable the cache before you install, modify, or repair Visual Studio.

Move the package cache

A common system configuration is to have Windows installed on an SSD that has a larger hard disk (or more) for development needs, such as source code, program binaries, and more. If you want to work offline, you can move the package cache instead.

Currently, you can do this operation only if you set the CachePath registry policy before you install, modify, or repair Visual Studio.

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:

  • We also offer an installation chat (English only) support option for installation-related issues.
  • Report product issues to us via 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.
  • Suggest a feature, track product issues, and find answers in the Visual Studio Developer Community.

See also