My below code fails no matter if I run it as Administrator or not:
var suff = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\CCM\\LocationServices", true);
var value = suff.GetValue("DnsSuffix").ToString();
I get this error message which I can't decode:
An unhandled exception of type 'System.NullReferenceException' occurred in MyApp.exe Additional information: Object reference not set to an instance of an object.
I know for a fact that the value exists and it contains data as well.
*Edit: So like I said it shouldn't be null as the data exists. And if it is null then I will need to know why is it null. Therefore, a question regarding what is System.NullReferenceException
won't help me at all.