Search code examples
asp.net.netvisual-studioinstallation

Visual Studio 2022 Install Failure - Microsoft.VisualCpp.Redist.14;PackageAction=Install;ReturnCode=1921


When attempting to install Visual Studio 2022 (same issue when attempting to install Visual Studio 2019), once the installation gets to a certain point it reports the following:

"Sorry, something went wrong" Couldn't install Microsoft.VisualCpp.Redist.14

Here is the log:

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

================================================================================ Package 'Microsoft.VisualCpp.Redist.14,version=14.34.31931,chip=x86' failed to install. Search URL https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualCpp.Redist.14;PackageAction=Install;ReturnCode=1921 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.34.31931,chip=x86\VCRedistInstall.ps1""" -PayloadDirectory """C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14,version=14.34.31931,chip=x86""" -Architecture x86 -Logfile """C:\Users\jbeaumont\AppData\Local\Temp\dd_setup_20221128140210_221_Microsoft.VisualCpp.Redist.14.log"""; exit $LastExitCode" Return code: 1921 Return code details: The name of the file cannot be resolved by the system. Log C:\Users\jbeaumont\AppData\Local\Temp\dd_setup_20221128140210_221_Microsoft.VisualCpp.Redist.14.log Impacted workloads .NET desktop development (Microsoft.VisualStudio.Workload.ManagedDesktop,version=17.4.33006.217,productarch=x64) ASP.NET and web development (Microsoft.VisualStudio.Workload.NetWeb,version=17.4.33006.217,productarch=x64) Impacted components .NET Debugging with WSL (Microsoft.VisualStudio.Component.WslDebugging,version=17.4.33006.217) .NET desktop development tools (Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites,version=17.4.33006.217) .NET profiling tools (Microsoft.VisualStudio.Component.DiagnosticTools,version=17.4.33006.217) ASP.NET and web development prerequisites (Microsoft.VisualStudio.Component.Web,version=17.4.33006.217) ASP.NET and web development prerequisites (Microsoft.VisualStudio.ComponentGroup.Web,version=17.4.33006.217) Azure WebJobs Tools (Component.Microsoft.VisualStudio.Web.AzureFunctions,version=17.4.33006.217) Azure WebJobs Tools (Microsoft.VisualStudio.ComponentGroup.AzureFunctions,version=17.4.33006.217) C# and Visual Basic (Microsoft.VisualStudio.Component.Roslyn.LanguageServices,version=17.4.33006.217) Cloud tools for web development (Microsoft.VisualStudio.ComponentGroup.Web.CloudTools,version=17.4.33006.217) Data sources for SQL Server support (Microsoft.VisualStudio.Component.SQL.DataSources,version=17.4.33006.217) Development tools for .NET (Microsoft.NetCore.Component.DevelopmentTools,version=17.4.33006.217) F# language support (Microsoft.VisualStudio.Component.FSharp,version=17.4.33006.217) F# language support for web projects (Microsoft.VisualStudio.Component.FSharp.WebTemplates,version=17.4.33006.217) Live Share (Component.Microsoft.VisualStudio.LiveShare.2022,version=1.0.5716) Managed Desktop Workload Core (Microsoft.VisualStudio.Component.ManagedDesktop.Core,version=17.4.33006.217) Razor Language Services (Component.Microsoft.VisualStudio.RazorExtension,version=17.4.33006.217) SQL Server Data Tools (Microsoft.VisualStudio.Component.SQL.SSDT,version=17.4.33006.217) Web development tools for .NET (Microsoft.NetCore.Component.Web,version=17.4.33006.217)


Solution

  • The offending issue was the following folder: C:\ProgramData\Package Cache

    It appears that somehow, this folder was changed from a folder to some sort of symbolic shortcut that was not accessible. It was semi-greyed out with a small arrow icon on the folder icon indicating it was a shortcut. Clicking on it resulted in the error "System is unable to resolve the file". Again, this is a FOLDER, not a FILE.

    Anyways, I deleted the "shortcut" and recreated C:\ProgramData\Package Cache as a normal folder and now everything is installing fine.