When install or uninstall Visual Studio, we may encounter an error message which saying "A problem has been encountered while loading the setup components. Canceling setup".
For above issue, we could use Windows Install Clean Up (i.e. A tool from MS to remove VS softwares) to remove Visual studio and then reinstall the software.
With the Windows Installer CleanUp Utility, you will remove a program's Windows Installer configuration information. You may want to remove the Windows Installer configuration information for your program if you experience installation (Setup) problems. For example, you may have to remove a program's Windows Installer configuration information if you have installation problems when you try to add (or remove) a component of your program that was not included when you first installed your program. The Windows Installer CleanUp Utility is provided "as is" to help resolve installation problems for programs that use Microsoft Windows Installer. If you use this utility, you may have to reinstall other programs. Caution is advised.