Why does my 32-bit application not access the 32-bit registry hive?
<p>I have a C# application that calls: </p>

<pre><code>Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\MyApp")                
</code></pre>

<p>It is set to target x86, and when I run it I can see from Task Manager that it is a 32-bit process. However that line of code is strangely going to the 64-bit hive at HKCU\Software\MyApp, instead of the 32-bit hive at HKCU\Software\Wow6432Node\MyApp. Any ideas?</p>

<p>I also started two instances of Powershell, one 32-bit and one 64-bit, and ran the below but both return the values at the 64-bit hive too.</p>

<pre><code>get-itemproperty -Path Registry::HKEY_CURRENT_USER\Software\MyApp 
</code></pre>

<p>Any ideas what might have gone wrong here? I have triple-checked that the registry settings at the 32 and 64 bit hives are different from regedit too.</p>
