{"id":5864,"date":"2017-09-01T17:00:21","date_gmt":"2017-09-02T00:00:21","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/?p=3845"},"modified":"2019-02-17T15:29:16","modified_gmt":"2019-02-17T22:29:16","slug":"cleaning-up-corrupt-visual-studio-instances","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/cleaning-up-corrupt-visual-studio-instances\/","title":{"rendered":"Cleaning up corrupt Visual Studio instances"},"content":{"rendered":"<p>A small number of users are seeing errors after installing or modifying Visual Studio 2017 like the following,<\/p>\n<blockquote><p>Sorry, the installation failed. Please try again.<\/p><\/blockquote>\n<p>This may also manifest in some cases as,<\/p>\n<blockquote><p>A product matching the following parameters cannot be found:<\/p>\n<p>channelId: VisualStudio.15.Release\nproductId: Microsoft.VisualStudio.Product.Enterprise<\/p><\/blockquote>\n<p>If you open the latest %TEMP%\\dd_client*.log file you may see an exception stack trace like,<\/p>\n<pre class=\"\">2017-08-07T03:20:00 : Error : Failed to get installed product summaries. [installerId: SetupEngine, error: System.NullReferenceException: Object reference not set to an instance of an object.\r\n  at Microsoft.VisualStudio.Setup.Cache.InstanceRepository.GetInstance()\r\n  at Microsoft.VisualStudio.Setup.Cache.CacheRepository.d__32.MoveNext()\r\n  at Microsoft.VisualStudio.Setup.InstalledProductsProviderService.GetInstalledProductSummariesImpl()\r\n  at Microsoft.VisualStudio.Setup.InstalledProductsProviderService.GetInstalledProductSummaries()<\/pre>\n<p>Subsequent operations in the Visual Studio Installer fail, and if you reopen the Visual Studio Installer you may not see any instances installed \u2013 only what products are available.<\/p>\n<h3>Solution<\/h3>\n<p>We have mitigated a couple of possible causes and continue to explore both mitigations and long-term remedies, but in the meantime, you will need to clean up, or obliterate, the instance and re-install.<\/p>\n<ol>\n<li>Open an elevated command prompt.<\/li>\n<li>Run: <code>%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\resources\\app\\layout\\InstallCleanup.exe -i<\/code><\/li>\n<\/ol>\n<p>This will clean up only instance data such as the installation directory and state. This will make re-installing the instance faster since any workloads and components you had installed would remain cached and would not be re-downloaded.<\/p>\n<p>If you don\u2019t not find <em>InstallCleanup.exe<\/em> in <em>%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\resources\\app\\layout<\/em> \u2013 or any directory there above \u2013 please download the latest bootstrapper from <a href=\"https:\/\/www.visualstudio.com\/downloads\/\">https:\/\/www.visualstudio.com\/downloads\/<\/a> and run it to install. When the workload selection dialog is shown, close the window and run the steps above again.<\/p>\n<p><strong>Update:<\/strong> for up-to-date information, please see <a href=\"https:\/\/aka.ms\/vs\/cleanup\">https:\/\/aka.ms\/vs\/cleanup<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When older versions of Visual Studio 2017 report an error about not being able to load the instance, follow these instructions to clean up corrupt instances and re-install.<\/p>\n","protected":false},"author":389,"featured_media":3843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[20,40,45,49,57],"class_list":["post-5864","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-installation","tag-troubleshooting","tag-visual-studio","tag-vs15","tag-vs2017"],"acf":[],"blog_post_summary":"<p>When older versions of Visual Studio 2017 report an error about not being able to load the instance, follow these instructions to clean up corrupt instances and re-install.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/5864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=5864"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/5864\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=5864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=5864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=5864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}