title: Certificate Installation Access Denied Error
body: <p>I am trying to add a certificate inside localMachine Root. Below is the code for what I tried but this is not allowing me to add into Local Machine, while coming to add it say's access denied. How to allow to install inside Local Machine?</p>
  
  <pre class="lang-C# prettyprint-override"><code>X509Certificate2 cert = new X509Certificate2(@"D:\MyCertificate.pfx", "Temp@1234",
                  X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);
  // save certificate and private key
  X509Store storeMy = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
  storeMy.Open(OpenFlags.ReadWrite);
  storeMy.Add(cert);
  </code></pre>