Today i was debugging the code, it was written like this
string _retValue = ""; Microsoft.Win32.RegistryKey _rKey; Object _rKeyObject; string REG_KEY_PATH_PROFILE = "SOFTWARE\\Wow6432Node\\Mycompany\\e-business\\Platform\\profile\\"; try { _rKey = Microsoft.Win32.Registry.LocalMachine; _rKeyObject = _rKey.OpenSubKey(REG_KEY_PATH_PROFILE).GetValue(keyName); _retValue = Convert.ToString(_rKeyObject); return _retValue; }
It was returning null value every time, then i came to know i am building the application on 64 bit, To make the work around we can change project setup like this given below