I am running my application compiled as x86, and it is running on 64 bit Windows.
In order to fix a problem with ClickOnce file associations I want to read some CLS
I might be misunderstanding what you're asking but if you're running in a 32bit process then all your keys will be in the Wow6432Node\xxxxx
node anyway. So if you tried to copy them from HKEY_CURRENT_USER\Software\Classes\CLSID\{my clsid}
(and didn't specify the 64 bit view manually) to HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{my clsid}
you would be copying the same values. This code should work:
keyPath = @"Software\Classes\CLSID\" + clsid;
var regularx86View = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
// Note this calls HKEY_CURRENT_USER\Software\Classes\Wow6432Node\CLSID\{my clsid}:
var regularClassKey = regularx86View.OpenSubKey(keyPath, RegistryKeyPermissionCheck.ReadSubTree);
var regularx64View = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64);
// Note this calls HKEY_CURRENT_USER\Software\Classes\CLSID\{my clsid}:
var regularClassKey = regularx64View.OpenSubKey(keyPath, RegistryKeyPermissionCheck.ReadSubTree);