在 Visual Studio 2017 中選取安裝位置Select the installation locations in Visual Studio

您可以變更某些檔案的位置,來減少 Visual Studio 在系統磁碟機上的安裝磁碟使用量。You can reduce the installation footprint of Visual Studio on your system drive by changing the location for some of its files. 具體而言,您可以針對下載快取、共用元件、SDK 和工具檔案使用不同的位置。Specifically, you can use a different location for the download cache, shared components, SDKs, and tools files.

15.7 版的新功能:您可以變更某些檔案的位置,來減少 Visual Studio 在系統磁碟機上的安裝磁碟使用量。New in version 15.7: You can reduce the installation footprint of Visual Studio on your system drive by changing the location for some of its files. 具體而言,您可以針對下載快取、共用元件、SDK 和工具檔案使用不同的位置。Specifically, you can use a different location for the download cache, shared components, SDKs, and tools files.

Note

某些工具和 SDK 對於可安裝的位置有不同的規則。There are some tools and SDKs that have different rules on where they can be installed. 這類工具和 SDK 會安裝在您的系統磁碟機上,即使您選擇其他位置也一樣。Such tools and SDKs are installed on your system drive even if you choose another location.

準備好開始著手了嗎?Ready to get started? 方式如下:Here's how.

  1. 當您安裝 Visual Studio 時,選擇 [安裝位置] 索引標籤。When you install Visual Studio, choose the Installation locations tab.

    Visual Studio 2017 - 選取安裝位置Visual Studio 2017 - Select the installation location

  2. 在 [Visual Studio IDE] 區段中,接受預設。In the Visual Studio IDE section, accept the default. Visual Studio 會安裝核心產品,並包含本版 Visual Studio 的特定檔案。Visual Studio installs the core product and includes files that are specific to this version of Visual Studio.

    [安裝位置] 索引標籤的 [Visual Studio IDE] 區段Visual Studio IDE section of the Installation Locations tab

    Tip

    如果您的系統磁碟機是固態硬碟 (SSD),建議您接受系統磁碟機上的預設位置。If your system drive is a solid-state drive (SSD), we recommend that you accept the default location on your system drive. 理由何在?The reason? 當您使用 Visual Studio 開發時,您會讀取並寫入大量檔案,其會增加磁碟 I/O 活動。When you develop with Visual Studio, you read from and write to a lot of files, which increases the disk I/O activity. 最好選擇最快的磁碟機來處理負載。It's best to choose your fastest drive to handle the load.

  3. 在 [下載快取] 區段中,決定是否要保留下載快取,然後決定要儲存其檔案的位置。In the Download cache section, decide if you want to keep the download cache, and then decide where you want to store its files.

    [安裝位置] 索引標籤的 [下載快取] 區段Download Cache section of the Installation Locations tab

    1. 核取或取消核取 [在安裝後保留下載快取]。Check or uncheck Keep download cache after the installation.

      如果您決定不要保留下載快取,則只會暫時使用此位置。If you decide not to keep the download cache, the location is used only temporarily. 此動作不會影響或刪除先前安裝的檔案。This action won't affect or delete files from previous installations.

    2. 指定您要從下載快取儲存安裝檔案和資訊清單的磁碟機。Specify the drive where you want to store installation files and manifests from the download cache.

      例如,如果您選取 [使用 C++ 的桌面開發] 工作負載,暫時會需要系統磁碟機上 1.58 GB 的大小,然後會在安裝完成時予以釋放。For example, if you select the "Desktop development with C++" workload, the temporarily required size is 1.58 GB on your system drive, which is then freed as soon as the installation completes.

      Important

      此位置會在您第一次安裝時設定,而且之後無法從安裝程式 UI 變更。This location is set with your first installation and cannot be changed later from the installer UI. 相反地,您必須使用命令列參數來移動下載快取。Instead, you must use command-line parameters to move the download cache.

  4. 在 [共用的元件、工具及 SDK] 區段中,指定您要儲存檔案以供並存 Visual Studio 安裝共用的磁碟機。In the Shared components, tools, and SDKs section, specify the drive where you want to store the files that are shared by side-by-side Visual Studio installations. SDK 和工具也會儲存在此目錄中。SDKs and tools are also stored in this directory.

    [安裝位置] 索引標籤的 [共用的元件、工具及 SDK] 區段Shared Components, Tools, And SDKs section of the Installation Locations tab

  1. 當您安裝 Visual Studio 時,選擇 [安裝位置] 索引標籤。When you install Visual Studio, choose the Installation locations tab.

    Visual Studio 2019 - 選取安裝位置Visual Studio 2019 - Select the installation location

  2. 在 [Visual Studio IDE] 區段中,接受預設。In the Visual Studio IDE section, accept the default. Visual Studio 會安裝核心產品,並包含本版 Visual Studio 的特定檔案。Visual Studio installs the core product and includes files that are specific to this version of Visual Studio.

    Tip

    如果您的系統磁碟機是固態硬碟 (SSD),建議您接受系統磁碟機上的預設位置。If your system drive is a solid-state drive (SSD), we recommend that you accept the default location on your system drive. 理由何在?The reason? 當您使用 Visual Studio 開發時,您會讀取並寫入大量檔案,其會增加磁碟 I/O 活動。When you develop with Visual Studio, you read from and write to a lot of files, which increases the disk I/O activity. 最好選擇最快的磁碟機來處理負載。It's best to choose your fastest drive to handle the load.

  3. 在 [下載快取] 區段中,決定是否要保留下載快取,然後決定要儲存其檔案的位置。In the Download cache section, decide if you want to keep the download cache, and then decide where you want to store its files.

    • 核取或取消核取 [在安裝後保留下載快取]。Check or uncheck Keep download cache after the installation.

      如果您決定不要保留下載快取,則只會暫時使用此位置。If you decide not to keep the download cache, the location is used only temporarily. 此動作不會影響或刪除先前安裝的檔案。This action won't affect or delete files from previous installations.

    • 指定您要從下載快取儲存安裝檔案和資訊清單的磁碟機。Specify the drive where you want to store installation files and manifests from the download cache.

      例如,如果您選取 [使用 C++ 的桌面開發] 工作負載,暫時會需要系統磁碟機上 1.58 GB 的大小,然後會在安裝完成時予以釋放。For example, if you select the "Desktop development with C++" workload, the temporarily required size is 1.58 GB on your system drive, which is then freed as soon as the installation completes.

      Important

      此位置會在您第一次安裝時設定,而且之後無法從安裝程式 UI 變更。This location is set with your first installation and cannot be changed later from the installer UI. 相反地,您必須使用命令列參數來移動下載快取。Instead, you must use command-line parameters to move the download cache.

  4. 請注意,[共用的元件、工具及 SDK] 區段中所使用磁碟機和您在 [下載快取] 區段中選擇的磁碟機一樣。In the Shared components, tools, and SDKs section, note that it uses the same drive that you chose in the "Download cache" section. \Microsoft\VisualStudio\Shared 目錄是 Visual Studio 儲存並排顯示 Visual Studio 安裝共用檔案的位置。The \Microsoft\VisualStudio\Shared directory is where Visual Studio stores the files that are shared by side-by-side Visual Studio installations. SDK 和工具也會儲存在此目錄中。SDKs and tools are also stored in this directory.

取得支援Get support

有時可能會發生一些問題。Sometimes, things can go wrong. 若 Visual Studio 安裝失敗,請參閱針對 Visual Studio 安裝和升級問題進行疑難排解中的逐步說明。If your Visual Studio installation fails, see Troubleshooting Visual Studio installation and upgrade issues for step-by-step guidance.

我們也提供即時聊天 (僅限英文) 支援選項,可回答有關安裝的相關問題。We also offer a live chat (English only) support option for installation-related issues.

以下是一些支援選項:Here are a few more support options:

另請參閱See also