title: CertificateStore's Certificates.Find() doesn't actually find the certificate
body: <p>
  Here's my simple method:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private static X509Certificate2 GetCertificateFromStore(StoreLocation storeLocation, string certName) {
      var store = new X509Store(StoreLocation.LocalMachine);
      try {
          store.Open(OpenFlags.ReadOnly);
          var certs = store.Certificates.Find(X509FindType.FindBySubjectName, certName, true);
          return certs.Count == 0 ? null : certs[0];
      }
      finally {
          store.Close();
      }
  }
  </code></pre>
  
  <p>Debug locals show that <code>store.Certificates</code> has been loaded and contains two certificates — the default "localhost" one and one I've imported, so the correct store has been successfully opened.</p>
  
  <p>However, the <code>Find()</code> method always returns an empty result, regardless of which certificate I search for and whether I use <code>FindBySubjectName</code> or <code>FindByThumbprint</code>.</p>
  
  <p>Any ideas what could be wrong? It is a simple console app created for the sole purpose of learning &amp; testing certificate loading, i.e., virtually nothing in project configuration or anywhere else is other than default.</p>