title: Visual Studio 2017 Pro forgot it is installed
body: <p>After updating Visual Studio 2017 Pro to the latest version as of this writing (15.6.2, updated from 15.5.2) I have the strangest problem. So I can start Visual Studio perfectly fine and all, but whenever I attempt <em>any</em> operations that have to do with the Visual Studio Installer or the installation/update of extensions, they fail.</p>
  
  <p><strong>Question:</strong> Is there any way, short of wiping my installation and reinstalling from scratch, that would allow me to recover from this problem?</p>
  
  <p>As for extensions this is what I get to see (I am also giving the textual form so it can be indexed by search engines):</p>
  
  <blockquote>
    <p>Modifications Failed</p>
    
    <p>Some modifications could not be applied successfully. For more
    information, click on the install log link at the bottom of the
    dialog.</p>
    
    <p>Element not found. (Exception from HRESULT: 0x80070490)</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/mHzFb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mHzFb.png" alt="VSIX Installer error 0x80070490"></a></p>
  
  <p>Final lines from said installation log:</p>
  
  <pre><code>2018-03-15 08:39:12 - System.Runtime.InteropServices.COMException (0x80070490): Element not found. (Exception from HRESULT: 0x80070490)
     at Microsoft.VisualStudio.Setup.Configuration.ISetupConfiguration2.GetInstanceForPath(String path)
     at VSIXInstaller.LocationBasedSKU..ctor(String appidInstallPath, String appidName, Version vsVersion, String edition, String rootSuffix)
     at VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable`1&amp; skuData)
     at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
     at VSIXInstaller.App.Initialize()
     at System.Threading.Tasks.Task`1.InnerInvoke()
     at System.Threading.Tasks.Task.Execute()
  </code></pre>
  
  <p>It only gets stranger when starting the Visual Studio Installer. In this case I am greeted by the following error:</p>
  
  <blockquote>
    <p>The installed product matching the following parameters cannot be
    found: C:\Program Files (x86)\Microsoft Visual
    Studio\2017\Professional</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/l7l6i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l7l6i.png" alt="The installed product matching the following parameters cannot be found: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional"></a></p>
  
  <p>Dismissing that, I get a Visual Studio Installer window that looks as if there was <em>no edition</em> of the product installed. Alas, I can start Visual Studio 2017 Pro just fine.</p>
  
  <p><a href="https://i.stack.imgur.com/RJIQp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RJIQp.png" alt="Visual Studio Installer offering to install Visual Studio 2017 Pro"></a></p>
  
  <p>If I then proceed in order to install it, the window with the workload selection shows me this in the lower right:</p>
  
  <blockquote>
    <p>Visual Studio cannot be installed to a nonempty directory 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional'.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/zVe4F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zVe4F.png" alt="Visual Studio cannot be installed to a nonempty directory &#39;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional&#39;."></a></p>
  
  <hr>
  
  <p>Symptoms are the same no matter whether I start Visual Studio as privileged or unprivileged user.</p>
  
  <hr>
  
  <p>This just happened once again <em>after</em> I had previously upgraded to 15.8 and now wanted to upgrade to 15.8.1. The Visual Studio Installer doesn't see that VS 2017  Pro is installed and attempts to open solution files give the following unhelpful dialog box:</p>
  
  <p><a href="https://i.stack.imgur.com/yLitV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yLitV.png" alt="Choose Application"></a></p>
  
  <p>I should also add that this is a Windows 10 system this time, which I use as a secondary development machine.</p>
  
  <p>Visual Studio 2017 Pro starts fine from the start menu shortcuts, but everything seems borked. SDV refuses to load and the other symptoms mentioned above also apply.</p>