針對 Visual Studio 安裝和升級問題進行疑難排解Troubleshoot Visual Studio installation and upgrade issues

Important

遇到安裝問題嗎?Having a problem installing? 我們可以幫您。We can help. 我們提供即時交談 (僅限英文) 支援選項。We offer a live chat (English only) support option.

此疑難排解指南包括逐步指示,應該可以解決大部分的安裝問題。This troubleshooting guide includes step-by-step instructions that should resolve most installation issues.

如何針對線上安裝進行疑難排解How to troubleshoot an online installation

下列步驟已針對傳統線上安裝最佳化。The following steps are optimized for a typical online installation. 針對影響離線安裝的問題,請參閱 如何針對離線安裝進行疑難排解For an issue that affects an offline installation, please see How to troubleshoot an offline installation.

步驟 1 - 查看此問題是否為已知問題Step 1 - Check whether this problem is a known issue

Visual Studio 安裝程式有一些已知問題,Microsoft 正在努力修正。There are some known issues with the Visual Studio Installer that Microsoft is working on fixing. 若要查看是否有您問題的因應措施,請參閱版本資訊的<已知問題>一節To see if there's a workaround for your problem, check the Known Issues section of our release notes.

Visual Studio 安裝程式有一些已知問題,Microsoft 正在努力修正。There are some known issues with the Visual Studio Installer that Microsoft is working on fixing. 若要查看是否有您問題的因應措施,請參閱版本資訊的<已知問題>一節To see if there's a workaround for your problem, check the Known Issues section of our release notes.

步驟 2 - 查看開發人員社群Step 2 - Check with the developer community

Visual Studio 開發人員社群(英文) 中搜尋您的錯誤訊息。Search on your error message with the Visual Studio Developer Community. 社群的其他成員可能已記錄您問題的解決方式。Other members of the community might have documented a solution to your problem.

步驟 3 - 刪除 Visual Studio 安裝程式目錄,以修正升級問題Step 3 - Delete the Visual Studio Installer directory to fix upgrade problems

Visual Studio 安裝程式啟動載入器是最小的輕量型可執行檔,可安裝 Visual Studio 安裝程式的其餘部分。The Visual Studio Installer bootstrapper is a minimal light-weight executable that installs the rest of the Visual Studio Installer. 刪除 Visual Studio 安裝程式檔案,然後重新執行啟動載入器,可能可以解決一些更新失敗問題。Deleting Visual Studio Installer files and then rerunning the bootstrapper might solve some update failures.

Note

執行下列動作將會重新安裝 Visual Studio 安裝程式檔案並重設安裝中繼資料。Performing the following actions reinstalls the Visual Studio Installer files and resets the installation metadata.

  1. 關閉 Visual Studio 安裝程式。Close the Visual Studio Installer.
  2. 刪除 Visual Studio 安裝程式目錄。Delete the Visual Studio Installer directory. 此目錄通常是 C:\Program Files (x86)\Microsoft Visual Studio\InstallerTypically, the directory is C:\Program Files (x86)\Microsoft Visual Studio\Installer.
  3. 執行 Visual Studio 安裝程式啟動載入器。Run the Visual Studio Installer bootstrapper. 您可以在 [下載] 資料夾中找到檔名遵循 vs_[Visual Studio edition]__*.exe 模式的啟動載入器。You might find the bootstrapper in your Downloads folder with a file name that follows a vs_[Visual Studio edition]__*.exe pattern. 如果找不到該應用程式,請移至 Visual Studio 下載頁面並按一下您 Visual Studio 版本的 [下載] 來下載啟動載入器。If you don't find that application, you can download the bootstrapper by going to the Visual Studio downloads page and clicking Download for your edition of Visual Studio. 接著,執行該可執行檔來重設您的安裝中繼資料。Then, run the executable to reset your installation metadata.
  4. 嘗試重新安裝或更新 Visual Studio。Try to install or update Visual Studio again. 如果安裝程式持續失敗,請移至下一步驟。If the Installer continues to fail, go to the next step.
  1. 關閉 Visual Studio 安裝程式。Close the Visual Studio Installer.
  2. 刪除 Visual Studio 安裝程式目錄。Delete the Visual Studio Installer directory. 此目錄通常是 C:\Program Files (x86)\Microsoft Visual Studio\InstallerTypically, the directory is C:\Program Files (x86)\Microsoft Visual Studio\Installer.
  3. 執行 Visual Studio 安裝程式啟動載入器。Run the Visual Studio Installer bootstrapper. 您可以在 [下載] 資料夾中找到檔名遵循 vs_[Visual Studio edition]__*.exe 模式的啟動載入器。You might find the bootstrapper in your Downloads folder with a file name that follows a vs_[Visual Studio edition]__*.exe pattern. 如果找不到該應用程式,請移至 Visual Studio 下載頁面並按一下您 Visual Studio 版本的 [下載] 來下載啟動載入器。If you don't find that application, you can download the bootstrapper by going to the Visual Studio downloads page and clicking Download for your edition of Visual Studio. 接著,執行該可執行檔來重設您的安裝中繼資料。Then, run the executable to reset your installation metadata.
  4. 嘗試重新安裝或更新 Visual Studio。Try to install or update Visual Studio again. 如果安裝程式持續失敗,請移至下一步驟。If the Installer continues to fail, go to the next step.

步驟 4 - 回報問題Step 4 - Report a problem

在某些情況下 (例如與損毀的檔案相關的問題),則必須逐一查看問題。In some situations, such as those related to corrupted files, the problems might have to be looked at on a case-by-case basis. 為了幫助我們幫助您,請執行下列動作:To help us help you, please do the following:

  1. 收集您的安裝記錄檔。Collect your setup logs. 如需詳細資訊,請參閱如何取得 Visual Studio 安裝記錄檔See How to get the Visual Studio installation logs for details.
  2. 開啟 Visual Studio 安裝程式,然後按一下 [回報問題] 以開啟「Visual Studio 意見反應」工具。Open the Visual Studio Installer, and then click Report a problem to open the Visual Studio Feedback tool. 您可以使用 Tab 鍵移至 [提供意見反應] 按鈕以開啟意見反應工具You can tab to the Provide Feedback button to open the feedback tool
  3. 提供問題報告標題,並提供相關詳細資料。Give your problem report a title, and provide relevant details. 按一下 [下一步] 以移至 [附件] 區段,然後附加產生的記錄檔 (一般而言,該檔案位於 %TEMP%\vslogs.zip)。Click Next to go to the Attachments section, and then attach the generated log file (typically, the file is at %TEMP%\vslogs.zip).
  4. 按一下 [下一步] 以檢閱您的問題報告,然後按一下 [提交]。Click Next to review your problem report, and then click Submit.
  1. 收集您的安裝記錄檔。Collect your setup logs. 如需詳細資訊,請參閱如何取得 Visual Studio 安裝記錄檔See How to get the Visual Studio installation logs for details.
  2. 開啟 Visual Studio 安裝程式,然後按一下 [回報問題] 以開啟「Visual Studio 意見反應」工具。Open the Visual Studio Installer, and then click Report a problem to open the Visual Studio Feedback tool. 您可以使用 Tab 鍵移至 [提供意見反應] 按鈕以開啟意見反應工具You can tab to the Provide Feedback button to open the feedback tool
  3. 提供問題報告標題,並提供相關詳細資料。Give your problem report a title, and provide relevant details. 按一下 [下一步] 以移至 [附件] 區段,然後附加產生的記錄檔 (一般而言,該檔案位於 %TEMP%\vslogs.zip)。Click Next to go to the Attachments section, and then attach the generated log file (typically, the file is at %TEMP%\vslogs.zip).
  4. 按一下 [下一步] 以檢閱您的問題報告,然後按一下 [提交]。Click Next to review your problem report, and then click Submit.

步驟 5 - 執行 InstallCleanup.exe 以移除安裝檔案Step 5 - Run InstallCleanup.exe to remove installation files

非不得已,您可以移除 Visual Studio來移除所有安裝檔案和產品資訊。As a last resort, you can remove Visual Studio to remove all installation files and product information.

  1. 請遵循移除 Visual Studio 中的指示進行。Follow the instructions in Remove Visual Studio.
  2. 重新執行步驟 3 - 刪除 Visual Studio 安裝程式目錄,以修正升級問題中所述的啟動載入器。Rerun the bootstrapper that's described in Step 3 - Delete the Visual Studio Installer directory to fix upgrade problems.
  3. 嘗試重新安裝或更新 Visual Studio。Try to install or update Visual Studio again.

步驟 6 - 與我們連絡 (選擇性)Step 6 - Contact us (optional)

若上述步驟都無法協助您成功地安裝或升級 Visual Studio,請使用我們的即時聊天支援選項 (僅限英文) 與我們連絡以取得進一步的協助。If none of the previous steps help you successfully install or upgrade Visual Studio, contact us by using our live chat support option (English only) for further assistance.

如何針對離線安裝進行疑難排解How to troubleshoot an offline installation

下表列出從本機配置進行安裝時的已知問題與一些可能有幫助的因應措施。Here is a table of known issues and some workarounds that might help you when you install from a local layout.

問題Issue 項目Item 方案Solution
使用者沒有檔案的存取權。Users do not have access to files. 權限 (ACL)permissions (ACLs) 請務必在您共用離線安裝「之前」調整權限 (ACL),讓它們將「讀取權」授與其他使用者。Make sure that you adjust the permissions (ACLs) so that they grant Read access to other users before you share the offline install.
無法安裝新的工作負載、元件或語言。New workloads, components, or languages fail to install. --layout 如果是以部分配置來安裝,並選取該部分配置中先前未下載的工作負載、元件或語言,請確定可以存取網際網路。Make sure that you have internet access if you install from a partial layout and select workloads, components, or languages that were not downloaded previously in that partial layout.

如何取得 Visual Studio 安裝記錄檔How to get Visual Studio installation logs

針對大部分安裝問題進行疑難排解時,將會需要安裝記錄檔。Setup logs are needed to troubleshoot most installation issues. 使用 Visual Studio 安裝程式中的回報問題來提交問題時,會自動將這些記錄檔包含在報告中。When you submit an issue by using Report a Problem in the Visual Studio Installer, these logs are automatically included in your report.

當您連絡 Microsoft 支援服務時,可能需要使用 Microsoft Visual Studio 與 .NET Framework 記錄收集工具 (英文) 來提供這些安裝記錄檔。If you contact Microsoft Support, you might need to provide these setup logs by using the Microsoft Visual Studio and .NET Framework Log Collection Tool. 記錄收集工具會收集來自 Visual Studio 所安裝之所有元件的安裝記錄,包括 .NET Framework、Windows SDK 及 SQL Server。The log collection tool collects setup logs from all components installed by Visual Studio, including .NET Framework, Windows SDK, and SQL Server. 它也會收集電腦資訊、Windows Installer 詳細目錄與 Windows 事件記錄檔資訊,以供 Visual Studio 安裝程式、Windows Installer 與系統還原使用。It also collects computer information, a Windows Installer inventory, and Windows event log information for Visual Studio Installer, Windows Installer, and System Restore.

若要收集記錄檔:To collect the logs:

  1. 下載工具 (英文)。Download the tool.
  2. 開啟系統管理命令提示字元。Open an administrative command prompt.
  3. 從儲存工具的目錄執行 Collect.exeRun Collect.exe from the directory where you saved the tool.
  4. 在您的 %TEMP% 目錄中尋找產生的 vslogs.zip 檔案,例如 C:\Users\YourName\AppData\Local\Temp\vslogs.zipFind the resulting vslogs.zip file in your %TEMP% directory, for example, C:\Users\YourName\AppData\Local\Temp\vslogs.zip.

Note

執行工具所用的帳戶,必須相同於執行失敗安裝所用的帳戶。The tool must be run under the same user account that the failed installation was run under. 如果使用不同的使用者帳戶來執行工具,請設定 –user:<name> 選項,以指定執行失敗安裝所用的使用者帳戶。If you are running the tool from a different user account, set the –user:<name> option to specify the user account under which the failed installation was run. 如需其他選項與使用資訊,請從系統管理命令提示字元執行 Collect.exe -?Run Collect.exe -? from an administrator command prompt for additional options and usage information.

取得即時協助Get live help

若此疑難排解指南中所列的解決方式無法協助您成功地安裝或升級 Visual Studio,請使用我們的即時聊天支援選項 (僅限英文) 以取得進一步的協助。If the solutions listed in this troubleshooting guide do not help you to successfully install or upgrade Visual Studio, use our live chat support option (English only) for further assistance.

另請參閱See also