Could not install microsoft.netcore.hostpath 2019

Viewed 1968

I am trying to install Visual Studio 2019 but unfortunately every time I get this error

could not install Microsoft.NetCore.HostPath

Here is an image of the same:

enter image description here

5 Answers

Solution worked for me (nothing else helped)

  1. Install PowerShell v7 (https://aka.ms/pscore6)
  2. Backup original PowerShell v1 from C:\Windows\SysWOW64\WindowsPowerShell\v1.0
  3. Copy "C:\Program Files\PowerShell\7" to C:\Windows\SysWOW64\WindowsPowerShell\v1.0
  4. Rename pwsh.exe to powershell.exe
  5. Now VS installer is using PowerShell v7 thinking it is v1, works fine!

So, I believe it is kid of bug in old version of PowerShell

Probably there is better way to mimic version, I just did old school brutal magic after loosing a day for that

Activate the PowerShell privilege's, run gpupdate then restart the machine. then reinstall the setup again.

Set powershell execution policy to unrestricted. Open privileged powershell console and type

Set-ExecutionPolicy Unrestricted

re-execute setup.

Getting Windows PowerShell access worked for me.

I was not able to install VS2019 and VS2022.

Related