我正在尝试安装VS“15”预览5,我已经启动了新的安装程序,现在它说我必须卸载以前的版本(预览4)。 当我单击“删除”按钮时,卸载过程失败,这是日志文件中的错误:
2016-10-05T23:20:59 : Verbose : Getting installed product. [installerId: SetupEngine, installationId: 9554cc50, productId: Microsoft.VisualStudio.Product.Enterprise]
2016-10-05T23:20:59 : Verbose : Calling SetupEngine.Installer.UninstallProduct. [installPath: 'C:\Program Files (x86)\Microsoft Visual Studio\VS15Preview']
2016-10-05T23:20:59 : Error : Failed to get installed product. [installerId: SetupEngine, installationId: 9554cc50, productId: Microsoft.VisualStudio.Product.Enterprise, error: Sequence contains more than one element at at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Setup.Cache.CommonExtensions.GetProduct(IInstance instance, Boolean installedOnly)
at Microsoft.VisualStudio.Setup.InstalledProductsProviderService.CorrectChannelInformation(Instance instance)
at Microsoft.VisualStudio.Setup.InstalledProductsProviderService.GetInstalledProductForPathImpl(String path)
at Microsoft.VisualStudio.Setup.InstalledProductsProviderService.GetInstalledProductImpl(InstalledProductSummary productSummary)
at Microsoft.VisualStudio.Setup.InstalledProductsProviderService.GetInstalledProduct(InstalledProductSummary productSummary)]
2016-10-05T23:20:59 : Verbose : SetupEngine.Installer.UninstallProduct reported error. [InvalidOperationException: Sequence contains more than one element at at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
at Microsoft.VisualStudio.Setup.Cache.CommonExtensions.GetProduct(IInstance instance, Boolean installedOnly)
at Microsoft.VisualStudio.Setup.Cache.CacheRepository.GetAvailablePackages()
at Microsoft.VisualStudio.Setup.Engine.Initialize()
at Microsoft.VisualStudio.Setup.Engine.Uninstall(CancellationToken token)
at Microsoft.VisualStudio.Setup.InstallerService.UninstallProductImpl(InstalledProductSummary productSummary, TelemetryContext telemetryContext, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Setup.InstallerService.UninstallProduct(InstalledProductSummary productSummary, TelemetryContext telemetryContext, CancellationToken cancellationToken)]
2016-10-05T23:21:00 : Verbose : Getting installed product summaries. [installerId: SetupEngine]
2016-10-05T23:21:00 : Verbose : Getting product summaries. [installerId: SetupEngine]
有人可以帮助我吗?
答案 0 :(得分:16)
在尝试预览5之前,必须卸载所有以前版本的Visual Studio'15',并且可以通过Visual Studio Installer卸载以前的版本或使用“控制面板”中的“卸载程序”。当Visual Studio Installer无法工作时,我们可以手动删除Visual Studio,如下所示:
关闭Visual Studio安装程序
删除文件夹%ProgramData%\ Microsoft \ VisualStudio \ Packages \
删除Visual Studio文件夹安装文件夹(通常在%ProgramFiles(x86)%\ Microsoft Visual Studio \ VS15Preview下)
之后,删除先前的安装。再次启动Visual Studio Preview'15'的Visual Studio Installer进行安装 有关VS预览'15'安装的更多详细信息,您可以看到here。