Cannot read registry entry
<p>I have encountered an issue trying to read a registry entry on Windows server 2008.  The puzzling thing is the code does work on a different server that is also 2008, but is R2.  I have checked and the registry entry is in place, and I ran the program as Administrator.  Below is a code sample. The regitry key returned by Registry.LocalMachine.OpenSubKey is null. This is a 64 bit application</p>

<pre><code>string strPath = "";
try
{
    //The registry key:
    //SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\SnmpClient.exe
    using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(strKey))
    {
            try
            {
                //InstallDirectory
                if (!(rk.GetValue(strValue) == null))
                {
                    strPath += rk.GetValue(strValue).ToString();
                }
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
    }
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message);
}
return strPath;
</code></pre>
