Mian Bilal
Mian Bilal

Reputation: 31

Could not install microsoft.netcore.hostpath 2019

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

Upvotes: 2

Views: 2205

Answers (5)

Jamil Moughal
Jamil Moughal

Reputation: 29

Getting Windows PowerShell access worked for me.

I was not able to install VS2019 and VS2022.

Upvotes: 0

Abdurrahman Pektaş
Abdurrahman Pektaş

Reputation: 1

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

Set-ExecutionPolicy Unrestricted

re-execute setup.

Upvotes: 0

Oleksiy Datiy
Oleksiy Datiy

Reputation: 21

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

Upvotes: 2

Mian Bilal
Mian Bilal

Reputation: 31

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

Upvotes: 0

Imran Javed
Imran Javed

Reputation: 12667

If you have .Net 5 on your system and updating to 16.11.8 then you may face this issue. Till now only work around is to downgrade to 16.11.7. And you may have in uninstall and then reinstall VS 2019. You can get 16.11.7 or other older version of VS from following URL: https://learn.microsoft.com/en-us/visualstudio/releases/2019/history

Similar issue has been reported here too: Revert Visual Studio 2019 Update

Upvotes: 1

Related Questions