For one of our projects I changed the csproj Format in order to prepare for the .net Core migration. Currently we are using .net Framework 4.8.
I did not changed anything in the code but afterwards a bug occurred and the application was not capable of finding a registry key anymore. Both times the application was build in Debug with AnyCPU on the same 64 bit machine.
string registry_key32 = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key))
{
var subKeys = key.GetSubKeyNames();
}
This return ~400 keys before the change, afterwards it only returned ~200.
Why does the result of this method call changed when moving from the old csproj format to the new one?