I'm trying to get all the display name from the key:
"SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages"
and my code as follows:
using (RegistryKey baseKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages"))
{
foreach (string baseKeyName in baseKey.GetSubKeyNames())
{
dosomething();
}
return false;
}
After running and debugging the code above, i find the variable(basekey) is null so that the code will throw a exception.Although i have found some effective solutions that is just for .NET4.0 and higher, I wish get registry with .NET3.5. Is there any way for an application in 32bit mode to access the registry from 64bit system?