title: Registry GetSubKeyNames() lists different keys than Regedit?
body: <p>We are using WIX to install a number of services we create. I am writing a quick utility to dump the currently installed services. I just iterate over subkeys of:</p>
  
  <pre><code>SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall 
  </code></pre>
  
  <p>looking for <code>DisplayName</code>. The problem is, only two of my ten services show up in the list.</p>
  
  <p>However, when I look at the subkeys in Regedit, they are there. As well, they are in the installed programs (and I can find them in SELECT * from Win32_Product too).</p>
  
  <p>I looked through the MSDN docs, trying to find out if there is some special view of the registry that I am missing. Maybe it is a privilege issue? But I am running the tool as admin. Is there some hive mounting issue?</p>
  
  <p>Just to be clear with the code, here is the test app code (from <a href="https://stackoverflow.com/questions/908850/get-installed-applications-in-a-system">this answer</a>):</p>
  
  <pre><code>String registryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
  using(Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey))
  {
    foreach(String subkeyName in key.GetSubKeyNames())
      Console.WriteLine(key.OpenSubKey(subkeyName).GetValue("DisplayName"));
  }
  </code></pre>
  
  <p>Any thoughts on this?</p>