I'm trying to get the list of certificates from cert store. This is the code I'm using from this post Get list of certificates from the certificate store in C#:
X509Store store = new X509Store(StoreName.My);
store.Open(OpenFlags.ReadOnly);
foreach (X509Certificate2 mCert in store.Certificates)
{
// TODO
}
When I run this code from Test Explorer is finding all available certificates, but when I run it on my MVC application is not returning any certificate. I'm running VS 2013 as administrator.
Could you please address me what I'm doing wrong?
EDIT:
When I'm running the code on IIS Express I'm getting the list of certificates, but when I run it on Local IIS I'm not getting any results.
Regards,