title: Cannot read value of Registry Key - VB.NET - HKLM
body: <p>I'm trying to read the value of a string, 'Connection', under the registry key </p>
  
  <blockquote>
    <p>HKEY_Local_Machine\Software\Trebuchet\ServerSetup\Business Process
    Service</p>
  </blockquote>
  
  <p>In VB.NET, i'm attempting to read this key using the following code:</p>
  
  <pre><code>Private Function ReadRegistry()
      Dim KeyValue As String = ""
      Dim regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Trebuchet\ServerSetup\Business Process Service", False)
      If regkey IsNot Nothing Then KeyValue = CStr(regkey.GetValue("Connection"))
  
     Return KeyValue
  End Function
  </code></pre>
  
  <p>However, when attempting to check the registry, I receive a null for regkey. I've verified that the value is within that key, and have even replaced the text within the OpenSubKey call to be an exact copy of the key name as retrieved from RegEdit, but it seems the VB app can't read it for some reason.</p>
  
  <p>Am I missing something?</p>