I am banging my head around a constant error "Object reference not set to an instance of an object" when reading the value of a registry key. please give me your suggestions of how to resolve.
string regkey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A8EC0CC0-AD8D-4244-B080-424EDF7A7634}";
object thekey = Registry.LocalMachine.OpenSubKey(regkey).GetValue("DisplayName");
TraktorVersion = thekey.ToString();
where TraktorVersion is a string.