title: Unable to create/write values to Registry subkey despite Admin privileges C#
body: <p>In my console application, I want to create a DWORD value and set it's value to 2 to my registry sub key in Local machine. Please note, I own Administrator privileges to my machine. </p>
  
  <p>Here's my code below which is getting executed successfully but I am unable to see any value getting set in Registry.</p>
  
  <pre><code>            string keyPathI = @"SOFTWARE\Microsoft\Terminal Server Client";
              string keyPathII = @"SOFTWARE\WOW6432Node\Microsoft\Terminal Server Client";
  
              RegistryKey keyOne = Registry.LocalMachine.OpenSubKey(keyPathI, true);
              RegistryKey keyTwo = Registry.LocalMachine.OpenSubKey(keyPathII, true);
  
              if (keyOne != null)
              {
                  keyOne.SetValue("RemoteDesktop_SuppressWhenMinimized", 2, RegistryValueKind.DWord);
  
                  keyOne.Close();
              }
  
              if (keyTwo != null)
              {
                  keyTwo.SetValue("RemoteDesktop_SuppressWhenMinimized", 2, RegistryValueKind.DWord);
                  keyTwo.Close();
              }
  </code></pre>
  
  <p>Here's my app.manifest</p>
  
  <pre><code>&lt;assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
    &lt;assemblyIdentity version="1.0.0.0" name="MyApplication.app"/&gt;
    &lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"&gt;
      &lt;security&gt;
        &lt;requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"&gt;
          &lt;requestedExecutionLevel  level="requireAdministrator" uiAccess="false" /&gt;              
        &lt;/requestedPrivileges&gt;
      &lt;/security&gt;
    &lt;/trustInfo&gt;
  &lt;/assembly&gt;
  </code></pre>
  
  <p>What else I should do to write the values to Registry subkey ?</p>
  
  <p>P.S : Though there are many similar articles on web, I have referred all of them but none of them could help me out.</p>