I am trying to get the OS information from registry through ProductName key in HKLM\Microsoft\Windows NT\CurrentVersion but it does not seem to be present in my C# application in Windows Sandbox. However, when I check the registry value by manually opening the regedit
, it is present.
Are there any possible solutions for this?
I have tried getting information through following code:
var registry = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
string productName = registry.GetValue("ProductName").ToString();
registry.GetValue("ProductName")
seems to be null but it is present when I manually open the registry editor.