Could not install microsoft.netcore.hostpath 2019 - visual-studio

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:

Solution worked for me (nothing else helped)
Install PowerShell v7 (https://aka.ms/pscore6)
Backup original PowerShell v1 from C:\Windows\SysWOW64\WindowsPowerShell\v1.0
Copy "C:\Program Files\PowerShell\7" to C:\Windows\SysWOW64\WindowsPowerShell\v1.0
Rename pwsh.exe to powershell.exe
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

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

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

Couldn't install "packageName" and "anotherPackageName"

I am switching to Visual Studio 2022 for .Net core 3.1 but Installer can't install two packages.
I tried uninstall and reinstall too much but it cannot resolve this problem.
Errors:
Couldn't install Microsoft.VisualStudio.MinShell.Interop.Shared.Msi
Couldn't install Microsoft.AspNetCore.SharedFramework.6.0.6.0.1-servicing.21567.14.x64
How can I fix it? Can you help me?
Deep Note: I'm using Windows 10 home single language.
I fixed this problem, my message code is 1911 (you can see on logs).
If you have same problem you can follow this way:
Open Command prompt as administrator.
Type "sfc /scannow".
Reboot your computer when the process is complete.
Repair the Visual Studio installation.

Is it possible to install Visual Studio in a Windows Container

Is it possible to install any version of Visual Studio in a Windows Container on a Windows Server?
The motivation is to use Windows Containers for building software in continuous integration systems, so that the build environment is standardized.
Visual Studio seems to not be supported officially on Core Server, but I agree it would be really nice to be able to do this. Let's try:
FROM mcr.microsoft.com/windows/servercore:ltsc2019
SHELL ["powershell"]
RUN Invoke-WebRequest "https://aka.ms/vs/16/release/vs_community.exe" -OutFile "$env:TEMP\vs_community.exe" -UseBasicParsing
RUN & "$env:TEMP\vs_community.exe" --add Microsoft.VisualStudio.Workload.NetWeb --quiet --wait --norestart --noUpdateInstaller | Out-Default
RUN & 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe' /version
CMD ["powershell"]
(I'm pushing this image into lukaslansky/visualstudio-netwebworkload, use with caution.)
Output of the build is:
[...]
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
So this seems to work! You should play with those --add installator arguments to specify what components you need precisely for your build, they correspond to workloads and components you see in the GUI. See the documentation.
Your best bet at this point is to use Visual Studio Build Tools.
A way to install visual build chain in a windows container could be to use chocolatey package visualstudio2017buildtools.
Starting Dockerfile with something like :
FROM microsoft/windowsservercore
RUN powershell.exe -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SETX PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
RUN choco install -y visualstudio2017buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --installPath C:\BuildTools" || IF "%ERRORLEVEL%"=="3010" EXIT 0
RUN call "C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
Just for the record MS is not planning support VS inside containers, the best alternative that you have is MsBuild. Some months ago was possible but with the latest version from VS is not possible. Source: vsts-agents
Windows Containers do not currently include GUI apps. The limitation is on Microsoft, not on Docker.
For example try something simple like running Notepad (in Windows Server Core container). The process is launched but no GUI shows up.
I've recently spent a lot of time investigating this as our goal was to set up "dockerized" DevOps agents which were capable of running the VsBuild#1 pipeline task (among other things).
Generally, if you DON'T need VsBuild#1 (or some of the other tasks related to Visual Studio, like VsTest#2 or the like) then you're better of using https://hub.docker.com/_/microsoft-dotnet-framework-sdk/ as your base and call it a day; those images come with the Build Tools and VS Test agent already installed.
However it IS possible to install VS. Some notes:
I've had issues when installing VS on top of the images mentioned above. For some reason VS silently fails to copy some files when it detects some existing tools already being in place. As such, I recommend using the https://hub.docker.com/_/microsoft-dotnet-framework-runtime/ images as a base.
Installation must be "quiet" (since there's no GUI) and cannot request a restart.
From what I can tell VS would usually queue up some kind of pre-build process which isn't triggered when the system isn't restarted. This can be manually triggered, however, by running %windir%\Microsoft.NET\Framework64\v4.0.30319\ngen update. Do note that with a VS installation inside Docker this WILL fail in various ways, so you'll need to find ways around this.
Check the original DockerFile for the SDK images for some references; specifically interesting is the manual installation of .NET Framework targetting packs: https://github.com/microsoft/dotnet-framework-docker/blob/main/src/sdk/4.8.1/windowsservercore-ltsc2022/Dockerfile
(Should this link ever stop working because the file is moved then it's worth taking a look at the DockerFiles in the https://github.com/microsoft/dotnet-framework-docker repo)
Not all VS components can be installed! While I haven't nailed it down to which components are troublesome, a full VS install inside Docker will likely exceed default Docker disk space limits and / or run endlessly (soft lock as some proces will wait forever for some other installation process to finish). As such it is important to carefully curate the list of VS component IDs you wish to install using --add arguments.

Installation : Microsoft Visual C++ Redistributable stuck at 'Processing: Windows7_MSU_X64'

I'm trying to install the package of Microsoft Visual C++ Redistributable as my xampp apache module cannot be installed. The installation take a very long time to complete. What should I do? Is this common and is all I have to do is wait?
They are dead stuck with this setup progress as the indication
Processing: Windows7_MSU_X64
To install the Visual C++ 2015 Redistributable, you do not need to remove or uninstall the previous versions.
Refer to the error message, you can have a look at the installation log file and search ‘error’, if you can find the error message about Windows6.1-KB2999226-x64.msu, check this similar issue and have a try with the following to troubleshot this issue:
Download the update KB2999226 for your OS edition from here: Update for Universal C Runtime in Windows and before it, since your OS is windows 7, make sure SP1 is installed.
Manually install the KB2999226 as below:
Find the Windows6.1-KB2999226-x64.msu from the folder C:\ProgramData\Package Cache\xxxxx\packages\Patch\x64, which you can the path from the installation log
Create a folder named ‘XXXX’ in that and execute following commands from Admin command prompt
wusa.exe Windows6.1-KB2999226-x64.msu /extract:XXXX
DISM.exe /Online /Add-Package /PackagePath:XXXX\Windows6.1-KB2999226-x64.cab
vc_redist.x64.exe /repair
If you have no idea about the installation log, you can go to %temp% and order by ‘Date modified’, then you should find the installation log, or you can use http://aka.ms/vscollect to gather the installation logs. After using it, you will find vslogs.zip under %temp% folder then upload the file to https://onedrive.live.com/ and share the link here.
I first tried a clean boot and that didn't work so I opened up the task manager to see what other processes I might kill while it was stuck at "Processing: Windows7_MSU_X64" I killed the process titled "windows update standalone installer" and the install completed successfully the moment I killed that process.
Okay, I found the solution for my stucked installation. I updated my Windows manually using wsusoffline tools as my Windows can't seem to update with the usual ways.
Install wsusoffline and select all update for Windows (Windows 7 for me). Make sure to choose the folder to save your update.
Wait for the update to be downloaded
Install the update
Install the MV C++ Redistributable again
Done!
I finally can install my Xampp Apache module and access to the localhost.

Aptana studio does not start without any error on windows 10

OS: Windows 10 x64
Aptana ver:3.6.1
When i try to start Aptana Studio nothing happens, no error, no new proccess in Task Manager, nothing. When i check log in workspace nothing there, i tried to delete file .snap in .metadata.plugins\org.eclipse.core.resources (solution founded in google) but it not exist.
Earlier it works perfectly ;/
I found a solution
So simply download the current x86-JDK, install it and try running Aptana again, that should do the trick!
source: https://steps0x29a.wordpress.com/2014/08/27/getting-aptana-studio-3-to-start-on-windows-7-x64/

Can't uninstall Visual Studio 2015 (The storage control blocks were destroyed)

So I wanted to force an uninstallation of VS2015 Enterprise with "vs_enterprise.exe /uninstall /force", but I get an error message:
Update for Microsoft Windows (KB2999226) : The storage control blocks were destroyed.
I tried to restart my PC, so that Windows can apply that update, but it didn't work, the uninstall process always exits with that error.
I have no idea how to proceed.
When I tried to uninstall Visual Studio 2015 Community Edition I first when to the Control Panel > Programs and Features, tried to uninstall it that way.
Then found the following link:
force uninstall a visual studio 2015 preview or release candidate
Then navigated to C:\ProgramData and typed:
dir /s vs_community.exe
It generated this useful path info:
C:\ProgramData\Package Cache\{50b32652-69d2-4b93-9316-edcd12067b8b}
Then used Windows Explorer to go to that folder, Shift + Right Click > Open command window here and ran:
vs_community.exe /uninstall /force
I then got this error screen after a LONG time...
Then saw the below question:
removing visual studio components left behind after an uninstall
So I tried to run:
vs_community.exe /repair
It ended up hanging and I force quit it after about a half hour. Then I ran:
vs_community.exe /uninstall /force
This time I checked the error log, and found the following line very near the bottom.
Applying execute package: Windows7_MSU_x64, action: Uninstall, path: 2999226, arguments: '"C:\windows\SysNative\wusa.exe" /uninstall /kb:2999226 /quiet /norestart'
Thought I had to install the KB2999226 update because of the error:
Update for Microsoft Windows (KB2999226) : The storage control blocks were destroyed.
So I installed it, but vs_community.exe still wouldn't force uninstall. I probably already had the update installed, but can't find out because my windowsupdate.log file only goes back a month or so? Anyhow, my installing of the update probably didn't change anything.
According to the following articles:
sysnative folder 64 bit windows
File System Redirector - MSDN
The Windows7_MSU_x64 was trying to get to the C:\Windows\System32 folder, but because I have a 64-bit version of Windows 7, it was trying to reach the C:\windows\SysNative folder, because it is an auto-redirect to the real System32 folder. For some reason I don't have a SysNative folder, so...
I then went to Windows Update and uninstalled the KB2999226 update and went back to:
C:\ProgramData\Package Cache\{50b32652-69d2-4b93-9316-edcd12067b8b}
Ran the following again:
vs_community.exe /uninstall /force
This time it worked and I got the screen:
I had the same issue (WINDOWS 7) and I solved by making sure the following KB's were installed:
KB3139923
KB3072630
Having one installed without the presence of the other was causing the issue.
In case anyone encounters this again, the following did the trick for me:
Download and install KB2999226 from
https://www.microsoft.com/en-us/download/details.aspx?id=49093
Create a symbolic link from c:\Windowss\SysNative to c:\Windows\System32 using the following command line:
mklink /D c:\Windows\SysNative c:\Windows\System32
Running the following command from command prompt:
"C:\ProgramData\Package Cache\{68432bbb-c9a5-4a7b-bab3-ae5a49b28303}\vs_professional.exe" /uninstall /force
The {6844...} part might be different on different machines and the vs_professional.exe might be located at different location but I guess anyone should be able to search for it inside the "PackageCache" folder
I had just the same issue. But for me nothing here has worked.
The only way worked for me was the standard way through the Windows Uninstall panel. The only difference here you have to reboot and uninstall it again until the option disappeared from the panel.
The below steps fixed it for me.
First uninstall KB2999226:
wusa.exe /uninstall /kb:2999226 /quiet /norestart
Download and re-install KB2999226 (the one we just uninstalled above):
https://www.microsoft.com/en-us/download/details.aspx?id=49093
Uninstall Visual Studio from admin shell (you can use the install exe you originally used for the install):
vs_community.exe /uninstall /force

Resources