You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多
文档控制台
免费开始使用

Windows10 22h2下Visual Studio启动及安装失败问题求助

问题描述

Windows 10升级至22H2(版本19045)后,Visual Studio 2019无法启动,根源是32位PowerShell(c:\windows\syswow64\windowspowershell\v1.0\powershell.exe)运行失败。尝试修复VS2019(版本16.11.41)无效,安装VS2022社区版也因相同PowerShell问题失败。系统可正常运行其他32位应用,仅32位PowerShell异常,寻求解决方法。

具体错误日志

Something went wrong with the install.

You can troubleshoot the package failures by:

    1. Search for solutions using the search URL below for each package failure
    2. Modify your selections for the affected workloads or components and then retry the installation
    3. Remove the product from your machine and then install again

If the issue has already been reported on the Developer Community, you can find solutions or workarounds there. If the issue has not been reported, we encourage you to create a new issue so that other developers will be able to find solutions or workarounds. You can create a new issue from within the Visual Studio Installer in the upper-right hand corner using the "Provide feedback" button.

================================================================================

Package 'Microsoft.VisualCpp.Redist.14,version=14.40.33816,chip=x86' failed to install.
    Search URL
        https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualCpp.Redist.14;PackageAction=Install;ReturnCode=-1073741819
    Details
        Command executed: "c:\windows\syswow64\\windowspowershell\v1.0\powershell.exe" -NoLogo -NoProfile -Noninteractive -ExecutionPolicy Unrestricted -InputFormat None -Command "& \"\"\"C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14,version=14.40.33816,chip=x86\VCRedistInstall.ps1\"\"\" -PayloadDirectory \"\"\"C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14,version=14.40.33816,chip=x86\"\"\" -Architecture x86 -Logfile \"\"\"C:\Users\username\AppData\Local\Temp\dd_setup_20241013044643_002_Microsoft.VisualCpp.Redist.14.log\"\"\"; exit $LastExitCode"
        Return code: -1073741819
        Return code details: Unknown error (0xc0000005)

解决办法

1. 修复32位PowerShell组件

  • 打开命令提示符(管理员),执行以下命令注册PowerShell相关组件:
    regsvr32.exe "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"
    
  • 若上述命令无效,执行系统文件检查修复损坏文件:
    sfc /scannow
    
  • 完成操作后重启电脑,手动运行c:\windows\syswow64\windowspowershell\v1.0\powershell.exe,确认是否能正常启动。

2. 手动安装VC Redist包

  • 从本地缓存路径找到VC Redist安装程序:C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14,version=14.40.33816,chip=x86
  • 找到路径中的vc_redist.x86.exe,双击手动运行安装,勾选协议完成操作。
  • 安装完成后,重新运行Visual Studio Installer进行修复或安装。

3. 统一PowerShell执行策略

  • 打开64位PowerShell(管理员),执行命令放宽执行策略:
    Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force
    
  • 切换到32位PowerShell(管理员),重复执行上述命令,确保策略生效。

4. 安装系统更新

  • 打开Windows更新,安装所有可用的累积更新和可选更新,重点修复.NET Framework、PowerShell相关的系统组件缺失问题。

内容的提问来源于stack exchange,提问作者James1

火山引擎 最新活动