Cannot (un)install Visual Studio 2017 anymore - uninstallation

I'm having serious issues getting VS2017 latest to run as it has gone into an inconsistent state while I was upgrading it. There are a few remnant packages that refuse to uninstall as they are apparently missing cached files from C:\Windows\Installer folder. I never touched that folder. I did, however, moved the C:\ProgramData\Packages Cache and Visual Studio folders to another drive using soft junctions (mklink /D)
Now, even after uninstalling VS2017, I cannot re-install it as it fails immediately reporting that:
The product failed to install the listed workloads and components due to one or more package failures.
Incomplete workloads
.NET Core cross-platform development (Microsoft.VisualStudio.Workload.NetCoreTools,version=15.0.26127.0)
.NET desktop development (Microsoft.VisualStudio.Workload.ManagedDesktop,version=15.0.26206.0)
ASP.NET and web development (Microsoft.VisualStudio.Workload.NetWeb,version=15.0.26206.0)
Node.js development (Microsoft.VisualStudio.Workload.Node,version=15.0.26206.0)
Visual Studio core editor (Microsoft.VisualStudio.Workload.CoreEditor,version=15.0.26004.1)
Incomplete components
.NET desktop development tools (Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites,version=15.0.26109.1)
.NET Framework 4.6.1 development tools (Microsoft.Net.ComponentGroup.DevelopmentPrerequisites,version=15.0.26206.0)
.NET Portable Library targeting pack (Microsoft.VisualStudio.Component.PortableLibrary,version=15.0.26109.1)
ASP.NET and web development tools (Microsoft.VisualStudio.Component.Web,version=15.0.26127.0)
Blend for Visual Studio (Microsoft.ComponentGroup.Blend,version=15.0.26004.1)
Blend for Visual Studio SDK for .NET (Microsoft.Component.Blend.SDK.WPF,version=15.0.26004.1)
C# and Visual Basic (Microsoft.VisualStudio.Component.Roslyn.LanguageServices,version=15.0.26109.1)
ClickOnce Publishing (Microsoft.Component.ClickOnce,version=15.0.26004.1)
Cloud Explorer (Microsoft.VisualStudio.Component.CloudExplorer,version=15.0.26206.0)
Connectivity and publishing tools (Microsoft.VisualStudio.Component.Common.Azure.Tools,version=1.9.170119.3)
Container development tools (Microsoft.VisualStudio.Component.DockerTools,version=15.0.26206.0)
Data sources and service references (Microsoft.VisualStudio.Component.VisualStudioData,version=15.0.26004.1)
Data sources for SQL Server support (Microsoft.VisualStudio.Component.SQL.DataSources,version=15.0.26004.1)
Developer Analytics tools (Microsoft.VisualStudio.Component.AppInsights.Tools,version=15.0.26206.0)
Entity Framework 6 tools (Microsoft.VisualStudio.Component.EntityFramework,version=15.0.26004.1)
IIS Express (Microsoft.VisualStudio.Component.IISExpress,version=15.0.26004.1)
IntelliTrace (Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd,version=15.0.26004.1)
JavaScript and TypeScript language support (Microsoft.VisualStudio.Component.JavaScript.TypeScript,version=15.0.26004.1)
JavaScript diagnostics (Microsoft.VisualStudio.Component.JavaScript.Diagnostics,version=15.0.26109.1)
Just-In-Time debugger (Microsoft.VisualStudio.Component.Debugger.JustInTime,version=15.0.26109.1)
Live Unit Testing (Microsoft.VisualStudio.Component.LiveUnitTesting,version=15.0.26206.0)
Managed Desktop Workload Core (Microsoft.VisualStudio.Component.ManagedDesktop.Core,version=15.0.26109.1)
Modeling SDK (Microsoft.VisualStudio.Component.DslTools,version=15.0.26109.1)
Node.js support (Microsoft.VisualStudio.Component.Node.Tools,version=15.0.26206.0)
NuGet package manager (Microsoft.VisualStudio.Component.NuGet,version=15.0.26004.1)
Profiling tools (Microsoft.VisualStudio.Component.DiagnosticTools,version=15.0.26109.1)
SQL Server Data Tools (Microsoft.VisualStudio.Component.SQL.SSDT,version=15.0.26206.0)
Text Template Transformation (Microsoft.VisualStudio.Component.TextTemplating,version=15.0.26004.1)
Visual Studio core editor (Microsoft.VisualStudio.Component.CoreEditor,version=15.0.26004.1)
Visual Studio SDK (Microsoft.VisualStudio.Component.VSSDK,version=15.0.26206.0)
Web Deploy (Microsoft.VisualStudio.Component.WebDeploy,version=15.0.26004.1)
WebSocket4Net (Component.WebSocket,version=15.0.26109.1)
Windows Communication Foundation (Microsoft.VisualStudio.Component.Wcf.Tooling,version=15.0.26109.1)
You can search for solutions using the information below, modify your selections for the above workloads and components and retry the installation, or remove the product from your machine.
Following is a collection of individual package failures that led to the incomplete workloads and components above. To search for existing reports of these specific problems, please copy and paste the URL from each package failure into a web browser. If the issue has already been reported, you can find solutions or workarounds there. If the issue has not been reported, you can create a new issue where other people will be able to find solutions or workarounds.
Package 'Microsoft.VisualStudio.MinShell.Msi,version=15.0.26206.0' failed to install.
Search URL: https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualStudio.MinShell.Msi;PackageAction=Install;ReturnCode=1714
Impacted workloads
.NET Core cross-platform development (Microsoft.VisualStudio.Workload.NetCoreTools,version=15.0.26127.0)
.NET desktop development (Microsoft.VisualStudio.Workload.ManagedDesktop,version=15.0.26206.0)
ASP.NET and web development (Microsoft.VisualStudio.Workload.NetWeb,version=15.0.26206.0)
Node.js development (Microsoft.VisualStudio.Workload.Node,version=15.0.26206.0)
Visual Studio core editor (Microsoft.VisualStudio.Workload.CoreEditor,version=15.0.26004.1)
Impacted components
.NET desktop development tools (Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites,version=15.0.26109.1)
.NET Framework 4.6.1 development tools (Microsoft.Net.ComponentGroup.DevelopmentPrerequisites,version=15.0.26206.0)
.NET Portable Library targeting pack (Microsoft.VisualStudio.Component.PortableLibrary,version=15.0.26109.1)
ASP.NET and web development tools (Microsoft.VisualStudio.Component.Web,version=15.0.26127.0)
Blend for Visual Studio (Microsoft.ComponentGroup.Blend,version=15.0.26004.1)
Blend for Visual Studio SDK for .NET (Microsoft.Component.Blend.SDK.WPF,version=15.0.26004.1)
C# and Visual Basic (Microsoft.VisualStudio.Component.Roslyn.LanguageServices,version=15.0.26109.1)
ClickOnce Publishing (Microsoft.Component.ClickOnce,version=15.0.26004.1)
Cloud Explorer (Microsoft.VisualStudio.Component.CloudExplorer,version=15.0.26206.0)
Connectivity and publishing tools (Microsoft.VisualStudio.Component.Common.Azure.Tools,version=1.9.170119.3)
Container development tools (Microsoft.VisualStudio.Component.DockerTools,version=15.0.26206.0)
Data sources and service references (Microsoft.VisualStudio.Component.VisualStudioData,version=15.0.26004.1)
Data sources for SQL Server support (Microsoft.VisualStudio.Component.SQL.DataSources,version=15.0.26004.1)
Developer Analytics tools (Microsoft.VisualStudio.Component.AppInsights.Tools,version=15.0.26206.0)
Entity Framework 6 tools (Microsoft.VisualStudio.Component.EntityFramework,version=15.0.26004.1)
IIS Express (Microsoft.VisualStudio.Component.IISExpress,version=15.0.26004.1)
IntelliTrace (Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd,version=15.0.26004.1)
JavaScript and TypeScript language support (Microsoft.VisualStudio.Component.JavaScript.TypeScript,version=15.0.26004.1)
JavaScript diagnostics (Microsoft.VisualStudio.Component.JavaScript.Diagnostics,version=15.0.26109.1)
Just-In-Time debugger (Microsoft.VisualStudio.Component.Debugger.JustInTime,version=15.0.26109.1)
Live Unit Testing (Microsoft.VisualStudio.Component.LiveUnitTesting,version=15.0.26206.0)
Managed Desktop Workload Core (Microsoft.VisualStudio.Component.ManagedDesktop.Core,version=15.0.26109.1)
Modeling SDK (Microsoft.VisualStudio.Component.DslTools,version=15.0.26109.1)
Node.js support (Microsoft.VisualStudio.Component.Node.Tools,version=15.0.26206.0)
NuGet package manager (Microsoft.VisualStudio.Component.NuGet,version=15.0.26004.1)
Profiling tools (Microsoft.VisualStudio.Component.DiagnosticTools,version=15.0.26109.1)
SQL Server Data Tools (Microsoft.VisualStudio.Component.SQL.SSDT,version=15.0.26206.0)
Text Template Transformation (Microsoft.VisualStudio.Component.TextTemplating,version=15.0.26004.1)
Visual Studio core editor (Microsoft.VisualStudio.Component.CoreEditor,version=15.0.26004.1)
Visual Studio SDK (Microsoft.VisualStudio.Component.VSSDK,version=15.0.26206.0)
Web Deploy (Microsoft.VisualStudio.Component.WebDeploy,version=15.0.26004.1)
WebSocket4Net (Component.WebSocket,version=15.0.26109.1)
Windows Communication Foundation (Microsoft.VisualStudio.Component.Wcf.Tooling,version=15.0.26109.1)
Log
D:\Users\6587\AppData\Local\Temp\dd_setup_20170215092106_005_Microsoft.VisualStudio.MinShell.Msi.log
Details
MSI: C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.MinShell.Msi,version=15.0.26206.0\Microsoft.VisualStudio.MinShell.Msi.msi, Properties: REBOOT=ReallySuppress ARPSYSTEMCOMPONENT=1 MSIFASTINSTALL="7" VSEXTUI="1" VS7.3643236F_FC70_11D3_A536_0090278A1BB8="E:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"
Return code: 1714
Return code details: The older version of vs_minshellmsi cannot be removed. Contact your technical support group.
This message is complaining about a certain package vs_minshellmsi not getting removed due to another package missing in C:\Windows\Installer. Now, I have tried numerous thing mentioned over the internet but I'm not having any luck:
Tried to find the missing file from a second PC running perfectly. No such file there
Completely removed the VS2017 Installer
Ran the VS2017 setup only to get VS20217 Installer installed so I could run InstallCleanup.exe -full
Created a full offline install point for VS2017 (--layout) and sought the packages in question
None of the above worked for me. Right now, I found a PS script to remove VS2017 preview-4 and trying to use that to resolve my situation but still no-op: https://gist.github.com/timsneath/9f9e384ef7b986fbcd873e75e4cae7c4
Here is the script:
# Setup assets
$foldersToDelete = ,"$env:ProgramData\Microsoft\VisualStudio\Packages"
$foldersToDelete += "$env:AppData\Microsoft\VisualStudio\Packages"
$foldersToDelete |? { Test-Path $_ } |% { del -rec -for $_ }
# VS assets
# Any VS installation folders
if (test-path $env:ProgramData\Microsoft\VisualStudio\Packages\_Instances) {
gci $env:ProgramData\Microsoft\VisualStudio\Packages\_Instances -filter state.json -recurse | gc -raw | convertfrom-json | select -expand installationPath | del -force -recurse
}
if (test-path "${env:ProgramFiles(x86)}\Microsoft Visual Studio") {
del -rec -for "${env:ProgramFiles(x86)}\Microsoft Visual Studio"
}
del -rec -for $env:localappdata\Microsoft\VisualStudio\15.0*,$env:AppData\Microsoft\VisualStudio\15.0*
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\ | findstr 15.0 |% { reg delete $_ /f }
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft | findstr VisualStudio_ |% { reg delete $_ /f }
Reg query HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio | findstr 15.0 |% { reg delete $_ /f }
# Remove all VS singletons
# get-package vs_* | uninstall-package
get-package -provider msi | where { $_.name -like "vs_*" } | uninstall-package -additionalArguments "IGNOREDEPENDENCIES=ALL"
I ran this script and it executed with no errors and output. The last line is what I'm interested in:
PS C:\Windows\system32> get-package -provider msi | where { $_.name -like "vs_*" }
Name Version Source ProviderName
---- ------- ------ ------------
vs_codecoveragemsi 15.0.26004 msi
vs_professionalmsi 15.0.26004 msi
vs_BlendMsi 15.0.26004 msi
vs_update3notification 14.0.25431 msi
vs_devenvmsi 15.0.26004 msi
vs_filehandler_x86 15.0.26004 msi
vs_cuitextensionmsi 15.0.26004 msi
vs_minshellinteropmsi 15.0.26004 msi
vs_SQLClickOnceBootstrappermsi 15.0.26004 msi
vs_tipsmsi 15.0.26004 msi
vs_communitymsires 15.0.26004 msi
vs_networkemulationmsi_x64 15.0.26004 msi
vs_cuitcommoncoremsi 15.0.26004 msi
vs_clickoncebootstrappermsi 15.0.26004 msi
vs_minshellmsires 15.0.26004 msi
vs_cuitextensionmsi_x64 15.0.26004 msi
vs_communitymsi 15.0.26004 msi
vs_enterprisemsi 15.0.26004 msi
vs_minshellmsi 15.0.26004 msi
vs_clickoncebootstrappermsires 15.0.26004 msi
vs_codeduitestframeworkmsi 15.0.26004 msi
vs_clickoncesigntoolmsi 15.0.26004 msi
vs_filehandler_amd64 15.0.26004 msi
I cannot get rid of these packages. When I run the last line, nothing happens and I'm still able to filter these particular packages.
EDIT
There are now a few packages left that I don't have sources of and cannot uninstall. I need a way to force remove these (marked with a *)
Name Version
vs_networkemulationmsi_x64 15.0.26208
vs_SQLClickOnceBootstrappermsi 15.0.26208
vs_communitymsires 15.0.26228
vs_webtestrecordermsi_x64 15.0.26208
vs_minshellmsi 15.0.26228
vs_filehandler_amd64 15.0.26228
vs_loadtestexceladdinmsi 15.0.26208
vs_Graphics_Singletonx64 15.0.26208
vs_BlendMsi 15.0.26004*
vs_update3notification 14.0.25431
vs_cuitcommoncoremsi 15.0.26208
vs_clickoncebootstrappermsires 15.0.26208
vs_minshellmsires 15.0.26228
vs_communitymsi 15.0.26228
vs_codecoveragemsi 15.0.26208
vs_filehandler_x86 15.0.26228
vs_professionalmsi 15.0.26228
vs_cuitextensionmsi 15.0.26208
vs_FileTracker_Singleton 15.0.26208
vs_devenvmsi 15.0.26208
vs_tipsmsi 15.0.26208
vs_helpconfigmsi 15.0.26208
vs_clickoncebootstrappermsi 15.0.26208
vs_cuitextensionmsi_x64 15.0.26004*
vs_minshellinteropmsi 15.0.26208
vs_Graphics_Singletonx86 15.0.26208
vs_webtestrecordermsi 15.0.26208
vs_feedbackclientmsi 15.0.26208
vs_enterprisemsi 15.0.26228
vs_codeduitestframeworkmsi 15.0.26004*
vs_clickoncesigntoolmsi 15.0.26208
vs_labtestagentdeployermsi 15.0.26208

I had same issue after my Windows crashed middle of setup i searched google a lot and i found a tool from microsoft that remove MSI package completely.
Program_Install_and_Uninstall from this page
in my case "vs" installer shows me same error each time different "Name" from log.
I just removed them one by one and problem solved.

Related

I am not able to create a unreal engine 4 c++ project

whenever i create a unreal engine 4 c++ project it throw this error
Running E:/program_files/UE_4.24/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="D:/Game Development/MyProject2/MyProject2.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
ERROR: Could not find NetFxSDK install dir; this will prevent SwarmInterface from installing. Install a version of .NET Framework SDK at 4.6.0 or higher.
I have installed ue4 4.24 version and visual studio 2019 and game development with c++ is also selected during the installination of visual studio 2019 . i downloaded .NET framework from microsoft website but when i install it says Your installination will not occur see below for reason why .NET Framework 4.8 or a later update is already installed on this computer. So what can i do Please Help Me !
Thanks in Advance
I had the same problem, when I tried downloaded .NET framework from microsoft website it said Your installation is not possible because .NET Framework 4.8 or a later update is already installed.
This fix worked:
https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1697074-can-t-package-my-project-netfxsdk
"crioto: Hello! As mentioned in the output, you need to install/update .NET Framework. You can do this by running Microsoft Visual Studio Installer, then click on "Modify" next to installed version of Visual Studio, switch tab to Individual Components and check latest version of .NET SDK.*"
Modifying the VS Installer solved the Issue

Data collector 'Code Coverage' failed to provide initialization information

I'm trying to create a code coverage report using the Build pipeline.
I have added the task of typeVisual Studio code in the build pipeline and have enabled the Code Coverage.
When the build is triggered. I'm getting :
Data collector 'Code Coverage' message: Data collector 'Code Coverage' failed to provide initialization information. Error: System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.Diagnostics.Logging.ProfilerInterop' threw an exception. ---> Microsoft.VisualStudio.Diagnostics.Common.InvariantException: Failed to load IntelliTrace Profiler binary or failed to locate functions.
and
---> System.ComponentModel.Win32Exception: The system cannot find the path specified
This is running the tests and all the tests are passed. However I'm not able to view the code coverage report. The report which it has created contains only information about the tests
Any input on where we specify the path will be useful.
You basically need Visual Studio Test Agent for Code Coverage.
There are 2 possible ways to install for this:
Option 1
Install Agents for Visual Studio 2019 on the Build server (download from here, see under Tools for Visual Studio 2019).
In the build pipeline edit the Visual Studio Test Assemblies task. Set Select test platform using to Specific location and set Path to vstest.console.exe to for example C:\Program Files (x86)\Microsoft Visual Studio\2019\TestAgent\Common7\IDE\Extensions\TestPlatform\vstest.console.exe.
Option 2
Add the Visual Studio test platform installer build task to your pipeline. (Add this task before the testing task).
In the Visual Studio Test Assemblies task you have to select Installed by Tools Installer as the Test platform version
Note: in my experience I had some tests who succeeded with option 1, but failed in option2. Sadly I don't have the time to figure out why...
I faced this issue when configuring a build container.
1 To install the Visual Studio 2019 Test Agent, I used Chocolatey
1.2 Install Chocolatey
ENV chocolateyUseWindowsCompression = false
SHELL ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command"]
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); `
[System.Environment]::SetEnvironmentVariable('PATH', "\"${env:PATH};%ALLUSERSPROFILE%\chocolatey\bin\"", 'Machine'); `
choco feature enable -n allowGlobalConfirmation;
1.2 Install the TestAgent with chocolatey
RUN choco install visualstudio2019testagent -y
2. Edit the VSTest task on your pipeline to use a specific location.
In my case, I've installed into the container the VSBuildTools. The VSTest task used the VSBuildTools vstest.console.exe but the execution needs some libraries that are located at the TestAgent folders.
vstestLocationMethod: location
vstestLocation: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\TestAgent\Common7\IDE\Extensions\TestPlatform\vstest.console.exe'
Had a similar problem after updating build agent and adding VS2017 capabilities.
Downloaded (from https://www.opendll.com): microsoft.intellitrace.profiler.dll
Add to folder C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\Extensions\TestPlatform\x64​
Good luck

Visual Studio installer fails on AspNetDiagnosticPack.msi

I have the problem described here.
Any attempt to install AspNetDiagnosticPack.msi
C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.AspNetDiagnosticPack.Msi,version=15.0.40314.0\AspNetDiagnosticPack.msi fails with error status: 1603.
I cannot add or remove any component using VS installer now.
I have installed VS 2017 Professional as follows:
Microsoft Visual Studio Professional 2017
Version 15.6.6
VisualStudio.15.Release/15.6.6+27428.2037
Microsoft .NET Framework
Version 4.7.02558
Installed Version: Professional
Visual C++ 2017 00370-20001-54960-AA753
Microsoft Visual C++ 2017
Visual F# Tools 10.1 for F# 4.1 00370-20001-54960-AA753
Microsoft Visual F# Tools 10.1 for F# 4.1
Application Insights Tools for Visual Studio Package 8.11.10402.2
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2017 15.0.40314.0
ASP.NET and Web Tools 2017
Azure App Service Tools v3.0.0 15.0.40215.0
Azure App Service Tools v3.0.0
C# Tools 2.7.0-beta3-62715-05. Commit Hash: db02128e6e3c4bdfc93e6ec425ac9162b4d4fe80
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Cookiecutter 15.6.18072.2
Provides tools for finding, instantiating and customizing templates in cookiecutter format.
Dotfuscator Community Edition 5.32.1.6167-6ce295ebd
PreEmptive Protection - Dotfuscator CE
JavaScript Language Service 2.0
JavaScript Language Service
JavaScript Project System 2.0
JavaScript Project System
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.51212.2
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package
Node.js Tools 1.4.11027.3
Adds support for developing and debugging Node.js apps in Visual Studio
NuGet Package Manager 4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
Python 15.6.18072.2
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.
Python - Django support 15.6.18072.2
Provides templates and integration for the Django web framework.
Python - IronPython support 15.6.18072.2
Provides templates and integration for IronPython-based projects.
Python - Profiling support 15.6.18072.2
Profiling support for Python projects.
SQL Server Data Tools 15.1.61801.210
Microsoft SQL Server Data Tools
TypeScript Tools 15.6.20202.3
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 2.7.0-beta3-62715-05. Commit Hash: db02128e6e3c4bdfc93e6ec425ac9162b4d4fe80
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
I thought that the problem originated in having some remains from previous VS editions. I could not uninstall namely ASP.NET and Web Tools 2013.1. I have finally removed it after all by reinstalling VS 2015 and using the FixIt tool from this answer.. But still AspNetDiagnosticPack.msi fails the same way.
I also tried to uninstall the web development role completely, since I will probably not use it soon, but installation allways fails. Is there any workaround to make the VS installer work again?
The msi log is here.
Action 15:50:02: WebConfigInitialize.
Action start 15:50:02: WebConfigInitialize.
MSI (s) (B8:F4) [15:50:02:244]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIFF27.tmp, Entrypoint: Initialize
MSI (s) (B8:40) [15:50:02:244]: Generating random cookie.
MSI (s) (B8:40) [15:50:02:244]: Created Custom Action Server with PID 10588 (0x295C).
MSI (s) (B8:14) [15:50:02:306]: Running as a service.
MSI (s) (B8:14) [15:50:02:306]: Hello, I'm your 32bit Impersonated custom action server.
SFXCA: Failed to create new CA process via RUNDLL32. Error code: 2
CustomAction WebConfigInitialize returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 15:50:02: WebConfigInitialize. Return value 3.
But the problem is within custom action WebConfigInitialize and the log is no big help. I have observed that there was an entry Microsoft ASP.NET and Web Tools 2015.1 - Visual Studio 2015 when I ran the uninstaller tool - and this entry failed uninstalling. Perhaps the origin of my problems is that I once installed some beta verison of ASP.NET with Visual Studio 2015. I do not need ASP.NET for now, but I the VS 2017 installer is stuck on the error.
I have found WebToolsExtensionsVS14_rc2_48.msi in cached packages on my computer and uninstalling this package fails the same way with 1603 as the 2017 current package.
Action 8:30:41: WebConfigInitialize.
Action start 8:30:42: WebConfigInitialize.
MSI (s) (48:BC) [08:30:42:012]: Creating MSIHANDLE (550) of type 790542 for thread 1980
MSI (s) (48:F0) [08:30:42:012]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIA2E1.tmp, Entrypoint: Initialize
MSI (s) (48!A0) [08:30:42:028]: Creating MSIHANDLE (551) of type 790531 for thread 928
SFXCA: Failed to create new CA process via RUNDLL32. Error code: 2
MSI (s) (48!A0) [08:30:42:028]: Closing MSIHANDLE (551) of type 790531 for thread 928
CustomAction WebConfigInitialize returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (48:F0) [08:30:42:028]: Closing MSIHANDLE (550) of type 790542 for thread 1980
Action ended 8:30:42: WebConfigInitialize. Return value 3.
Similar problem here, that one ended with reninstalling his machine.
Or is there some tool that would show the dependencies of a particular MSI package?
The Developer's community link that is current and relevant to the problem is here.
It says:
We have fixed the problem in an upcoming release. We've addressed the
managed custom action in the ASP.NET Diagnostic Pack that modifies the
root web.config file to use a native code action. This should avoid
the CLR errors previously reported when it tried to launch the managed
code DLL during the install.
The fix for this is now in our latest Visual Studio Preview release.
If you'd like to try out the fix, you can access the preview build
here: https://www.visualstudio.com/vs/preview
Looks like there is no workaround except waiting for Microsoft's fix to that faliling custom action. I have ignored this recommendation at first because I did not check the date of comments properly but they are only one month old.
But when I have tried to install the preview it ended with exactly the same error.
In 15.7.1 version the same error again.
UPDATE: It looks like the issue might be a managed code custom action failing in the MSI in question (.NET code that can't run - for whatever reason 1, 2, 3).
Suggestion
I would first try to 1) do the reboot I recommend below - to clear the air and release any locks - then 2) disable security software / anti-virus and 3) try the install and enable logging as described below.
Core Deployment Problems
As deployment goes, problems tend to center around: 1) something is locked (in use - by other processes or other users logged on), 2) something is blocked (access / permissions denied), 3) dependencies are missing for your custom actions or the whole installer (runtime requirements not satisfied - for example missing .NET runtime version), 4) something is corrupted (data file, OS settings, malware is often the culprit here - or unwise tinkering), 5) there is an unexpected system state such as the disk being full, or more exotic the date and time is wrong, or there is a licensing issue or some other oddity, etc...
That is a very simplified list of causes - there are obviously many further issues, for example 6) localization errors: hard coded paths, erroneous parsing of dates and time, invalid characters in path names, etc... 7) file and path names are too long, 8) and the Microsoft specialty: weird and unexpected incompatibilities between products not thought to have a valid reason to conflict with each other (different versions of Visual Studio, etc...), etc..., but that is going way too far for your problem. Still, here is a generic "deployment problems" summary from some time back - just for reference.
Procedure
Reboot: The first thing I would do is to reboot and then try to invoke the install the regular way. This is just to rule out this "simple solution" (which sometimes works). There could be files in use that the installer must replace in order to complete.
Logging: In order to maximize the available debugging information you could log the install with verbose logging and debugging information (if you have access to the MSI itself).
Open an elevated command prompt (right click and run as administrator)
Change current directory (cd) until you get to: C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.AspNetDiagnosticPack.Msi,version=15.0.40314.0\
MSI Log: Run this command (adjusting paths as appropriate - especially for the log file): msiexec.exe /i AspNetDiagnosticPack.msi /L*vx C:\Test.log
Enable All: You can enable logging for all MSI files (slows installs, but great for advanced users): http://www.installsite.org/pages/en/msifaq/a/1022.htm (section: "Globally for all setups on a machine")
Interpret: How to interpret an MSI log file: http://www.installsite.org/pages/en/msifaq/a/1045.htm
Event Log: You can also have a look in the event log. Rather than repeating the procedure here, I will link to a similar, recent answer.
Different User: This is unusual advice (and I haven't tried it), but sometimes you can succeed with difficult installs by creating a new local admin user on the machine, and then running the installer from there. It has to do with errors in the user profile. Not the first thing to try, but adding it as an option.
I tried to uninstall VS 2019(!) and I faced the same problem (I cannot add or remove any component using VS installer).
It hang for a long time and finally throwed an error at "AspNetDiagnosticPack.msi".
I found a solution that led me also to
%programdata%Microsoft\VisualStudio\Packages\Microsoft.VisualStudio.AspNetDiagnosticPack.Msi,version=16.3.283.64955
I simply ran the msi stand alone. During the process I was asked to do kind of clean up for an outstanding installation issue.
After that I ran the uninstall ( And later the reinstallation ) of VS 2019 again and it worked.
Maybe this solution helps you along with VS 2017

In Visual Studio Code 2017: msbuild : The term 'msbuild' is not recognized as the name of a cmdlet

msbuild : The term 'msbuild' is not recognized as the name of a cmdlet,
function, script file, or operable program.
As far as my googling goes, Visual Code should come with MSbuild. I have installed the C/C++ and msbuild Tools extensions to no avail. What can I do?
Edit: I am using Visual Studio Code 1.19.2
Likely it's a path issue. If you have VS2017 installed, it's probably in the directory C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
Try adding that to your path, then restart VS Code and try again.
I suggest you rethink you command-line approach.
Short plan
Install Visual Studio Build Tools 2017
Find proper MSBuild
Use it
Details
Using Build Tools will give you independence from Visual Studio installation.
Download Build Tools for Visual Studio 2017 from Visual Studio Downloads page (direct link)
Command-line arguments documented here: Use command-line parameters to install Visual Studio 2017
All workloads and components are listed here: Visual Studio Build Tools 2017 component directory
You can use PowerShell module VSSetup. Download it or install from here: Github: Microsoft/Visual Studio Setup PowerShell Module
Run MSBuild with build target (you can add additional required parameters)
# 1. Find MS Build
Import-Module $PSScriptRoot\VSSetup\VSSetup.psd1
$msBuildPath = (Get-VSSetupInstance | Select-VSSetupInstance -Version 15.0 -Product Microsoft.VisualStudio.Product.BuildTools).InstallationPath
if ([System.IntPtr]::Size -eq 8)
{
$global:msbuildPath = Join-Path $msBuildPath 'MSBuild\15.0\Bin\amd64'
}
else
{
$global:msbuildPath = Join-Path $msBuildPath 'MSBuild\15.0\Bin'
}
Write-Output "Using MSBuild from $global:msbuildPath"
Write-Output "MSBuild /version"
$msbuild = Join-Path $global:msbuildPath msbuild
& $msbuild /version
# 2. Build
& $msbuild "$sln_file" /t:Build /v:q /nologo
I don't believe that this is a good solution, but it's what I hacked together since the other suggestions didn't work. I installed Visual Studio Installer and installed MSBuild through that. I am having other issues now but at least msbuild is running.
I faced the same issue, what worked with me was to use dotnet instead of msbuild :
dotnet build

Vast Increase in build time after Upgrading from VS2015 to VS2017

Short Version:
Build times for a .NET solution have gone from an average of 12 minutes to 34 minutes.
Long Version:
I had a Visual Studio 2015 solution with three projects in it:
MVC web application targeting .NET 4.5
c# class library for models targeting .NET 4.5
c# class library for data access targeting .NET 4.5
The solution is being built successfully in TeamCity 2017.1.5 using an "MSBuild" build step and the MSBuild 14.0 tools. The TeamCity step has the following flags:
/p:DeployOnBuild=true /p:PublishProfile="%system.teamcity.build.workingDir%\WEBAPPLICATION\Properties\PublishProfiles\PUBLISHPROFILENAME.pubxml" /p:Configuration=CONFIGURATIONNAME /p:VisualStudioVersion=14.0 /p:AutoParameterizationWebConfigConnectionStrings=false /p:SkipExtraFilesOnServer=false /p:DeleteExistingFiles=true
This setup has enabled our continuous integration/continuous deployment for our development server. It may be important to note that locally, we do not build the MVC views, but the build configuration on TeamCity enables MVCBuildViews first thing. This results in speedier development for our team locally.
A need arose for the majority of our models project to be utilized by another .NET project. Because Microsoft deprecated Portable Class Libraries and our models project makes extensive use of the [Serializable] attribute, which is not supported by PCL without numerous changes, we made the decision to change the models project to a .NET Standard 2.0 library project. The end goal is that we will use our private NuGet server to package up this one .NET Standard 2.0 library project as a NuGet package for use in this other project.
We upgraded our development machines from Visual Studio 2015 to Visual Studio 2017, created a new .NET Standard 2.0 project within the same solution, copied all of our models from the older models project to the new project, updated all of our references in the web application and data access project, and changed the web application and data access projects to target .NET 4.6.2. The solution builds successfully locally and is working just fine.
I was able to get TeamCity to build this new version of our solution by making sure the server where the agents are installed has Visual Studio 2017 installed along with the 4.6.2 targeting pack (this part was annoying to figure out). After extensive trial and error, I was only able to get TeamCity to successfully build the solution using a batch file and calling the batch file with a command line build step.
Here is the call from TeamCity:
c:\MYBATCHFILE.bat "%system.teamcity.build.checkoutDir%" "CONFIGURATIONNAME" "PUBLISHPROFILENAME"
Here is the batch file:
"C:\Program Files\dotnet\dotnet.exe" restore %~1\NEWMODELSPROJECT
%~1\..\..\tools\nuget.commandline.4.4.0\tools\nuget.exe restore %~1
"C:\Program Files\dotnet\dotnet.exe" build %~1 /p:Configuration="Release"
"c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" %~1\DATAACCESSPROJECT\DATAACCESSPROJECT.csproj /p:Configuration=%~2 /p:Platform="AnyCpu" /p:VisualStudioVersion=15.0
"c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe" %~1\WEBAPPLICATION\WEBAPPLICATION.csproj /p:Configuration=%~2 /p:Platform="AnyCpu" /p:VisualStudioVersion=15.0 /p:DeployOnBuild=true /p:PublishProfile=%~1\WEBAPPLICATION\Properties\PublishProfiles\%~3.pubxml /p:AutoParameterizationWebConfigConnectionStrings=false /p:SkipExtraFilesOnServer=false /p:DeleteExistingFiles=true
Essentially, we use dotnet restore on the .NET Standard 2.0 project, NuGet restore on the rest of the solution, dotnet build the .NET Standard 2.0 project, and then MSBuild the other two projects in the solution with the MSBuild 15.0 tools and the same flags as we were using before.
We aren't seeing any issue with the solution locally, but within TeamCity, our average build time has skyrocketed from 12 minutes to 34 minutes. It is important to note that no other major change has occurred with the project during this upgrade. The biggest time sink, by far, is MvcBuildViews. Here is a highly redacted version of the build log, as taken from TeamCity:
[10:50:07] The build is removed from the queue to be prepared for the start
...
//all other steps of the build complete in this amount of time
...
[10:50:21] Step 8/15: Run Batch (Command Line) (33m:28s)
...
//the other portions of the above batch file run in this time period
...
[10:51:15] MvcBuildViews:
...
[11:23:50]
[11:23:50] 104 Warning(s)
[11:23:50] 0 Error(s)
[11:23:50]
[11:23:50] Time Elapsed 00:33:16.53
[11:23:50] Process exited with code 0
...
//minor clean up steps
...
[11:23:53] Build finished
These average times are the same whether the batch file is run by TeamCity or manually from the command line. So, to put it bluntly, what has happened between MSBuild 14.0 and MSBuild 15.0 that the MVCBuildViews task takes 3 times longer? Are there flags or options I can pass to MVCBuildViews to improve this build time?