Applies to: Visual Studio 2017 and later versions
When you try to install Microsoft Visual Studio 2017 or a later version, the installation wizard unexpectedly closes or indicates that it can't download some installation files. A missing certificate required for the Visual Studio install can cause this problem. This article provides guidance for resolving the missing certificate problem and enables you to successfully install Visual Studio.
Symptoms
The symptoms of this problem depend on whether you're trying an online installation or an offline installation.
Online installation
When you try an online installation of Visual Studio 2017 or a later version, the installation wizard displays the following message:
Before you get started, we need to set up a few things so that you can configure your installation.
After you select Continue in the message dialog box, the installation wizard closes and the installation stops.
Offline installation
When you try an offline installation of Visual Studio 2017 or a later version on a device that has limited or no internet access, the installation wizard displays the following error message:
Unable to download installation files. Check your internet connection and try again.
If your device has event logging enabled for the CryptoAPI (CAPI2), you also see the following error message in the CAPI2 Event Viewer logs (Event ID 30):
<Event>
<UserData>
<CertVerifyCertificateChainPolicy>
<Policy type="CERT_CHAIN_POLICY_BASE" constant="1" />
<Certificate fileRef="8D68C42C0E1487E33AFCD85B764E514AFC2F8772.cer" subjectName="Microsoft Corporation" />
<CertificateChain chainRef="{6B598FF8-1F8F-429E-AE87-001A5FE49268}" />
<Flags value="1" CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG="true" />
<Status chainIndex="0" elementIndex="-1" />
<EventAuxInfo ProcessName="vs_setup_bootstrapper.exe" />
<CorrelationAuxInfo TaskId="{3553E2D5-941F-428B-904E-ADEC5F1F20A7}" SeqNumber="1" />
<Result value="800B010A">
A certificate chain could not be built to a trusted root authority.
</Result>
</CertVerifyCertificateChainPolicy>
</UserData>
</Event>
To access the CAPI2 event logs from the Event Viewer, go to Applications and Services Logs > Microsoft > Windows > CAPI2 > Operational.
Enable CAPI2 logs
To enable CAPI2 event logging, follow these steps:
-
Open Event Viewer by pressing <kbd>Win</kbd> + <kbd>R</kbd>, type eventvwr, and then press <kbd>Enter</kdb>.
-
Navigate to Applications and Services Logs > Microsoft > Windows > CAPI2 > Operational.
-
To delete any previous logs, right-click Operational, and then select Clear Log.
-
To start logging, right-click Operational, and then select Enable Log.
:::image type="content" source="./media/install-failure-2017-later-versions/event-viewer-enable-capi2-logs.png" alt-text="Event Viewer showing the right-click menu to clear or enable logs for CAPI2.":::
-
Try again to install Visual Studio by using the offline installer.
-
After you reproduce the problem, the CAPI2 event logs should contain details about the installation failure.
-
To stop logging, right-click Operation, and then select Disable Log.
Cause
This problem can occur for one of the following reasons, depending on the type of installation:
- Offline installation: The device doesn't have the latest Microsoft Windows Code Signing PCA 2024 certificate that Visual Studio uses.
- Online installation: The device's internet access is restricted, and the user doesn't have permission to download the Microsoft Windows Code Signing PCA 2024 certificate.
Solution
To resolve this problem, follow these steps:
-
Download the Microsoft Windows Code Signing PCA 2024 certificate by using a device that has internet access.
-
Copy the certificate file to
C:\Tempon the device that experiences the installation problem. -
Install the Microsoft Windows Code Signing PCA 2024 certificate in the Trusted Root Certification Authorities store. You can install the certificate by using either the Certificate Import Wizard or command line:
-
To install using the command line, run the following command in an elevated Command Prompt window:
CertUtil -addStore CA "C:\Temp\Microsoft Windows Code Signing PCA 2024.crt" -
To install using the Certificate Import Wizard:
-
Right-click the certificate file and select Install Certificate.
-
In the Certificate Import Wizard, choose Local Machine and select Next.
-
Select Place all certificates in the following store.
-
Select Browse... and choose Trusted Root Certification Authorities.
-
Select Next, then select Finish to install the certificate.
-
-
-
Try again to install Visual Studio by using the offline installer.
Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
