I will be honest and let you know that I don麓t know a whole lot what I am talking about.
I am using a soap service that requires that I have a certificate installed.
Everything works fine except that from time to time all of a sudden my code does not find the required certificate and I have to read it in again and then everything starts working again.
here is the code I use to retrieve the certificate.
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
foreach(X509Certificate2 cert in store.Certificates)
if (cert != null && cert.Subject.Contains("my_cert"))
token = new X509SecurityToken(cert);
When I install in the certificate i right click -> Install pfx.
Choose local machine.
Check the "Include all extended properties."
Check "Automatically select the certificate store based in the type of certificate"
Any help will be appreciated, thanks.